diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/cluster/dht/src/tier.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/xlators/cluster/dht/src/tier.c b/xlators/cluster/dht/src/tier.c index 028a42f7a1a..7e3eaa02c02 100644 --- a/xlators/cluster/dht/src/tier.c +++ b/xlators/cluster/dht/src/tier.c @@ -448,10 +448,25 @@ tier_build_migration_qfile (demotion_args_t *args, gfdb_time_t time_in_past; int ret = -1; - remove (GET_QFILE_PATH (is_promotion)); + /* + * The first time this function is called, query file will + * not exist on a given instance of running the migration daemon. + * The remove call is optimistic and it is legal if it fails. + */ + + ret = remove (GET_QFILE_PATH (is_promotion)); + if (ret == -1) { + gf_msg (args->this->name, GF_LOG_INFO, 0, + DHT_MSG_LOG_TIER_STATUS, + "Failed to remove %s", + GET_QFILE_PATH (is_promotion)); + } + time_in_past.tv_sec = args->freq_time; time_in_past.tv_usec = 0; - if (gettimeofday (¤t_time, NULL) == -1) { + + ret = gettimeofday (¤t_time, NULL); + if (ret == -1) { gf_log (args->this->name, GF_LOG_ERROR, "Failed to get current timen"); goto out; |