diff options
author | N Balachandran <nbalacha@redhat.com> | 2017-01-06 21:06:23 +0530 |
---|---|---|
committer | Raghavendra G <rgowdapp@redhat.com> | 2017-01-22 23:15:17 -0500 |
commit | b21c51e6f0baa5145923637f54e79d221ca59cff (patch) | |
tree | 5ea789a79e28f1bed20df3a02b0e987074f44035 | |
parent | 5ff6af5c5955bc885925c15e34c9bc0862168c02 (diff) |
cluster/dht: Incorrect migration checks in fsync
Fixed the order of the migration phase checks
in dht_fsync_cbk. Phase1 should never be hit if op_ret
is non zero.
> Change-Id: I9222692e04868bffa93498059440f0aa553c83ec
> BUG: 1410777
> Reviewed-on: http://review.gluster.org/16350
> Smoke: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com>
> Tested-by: Raghavendra G <rgowdapp@redhat.com>
> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
(cherry picked from commit 83117c71482c9f87a0b6812094cbb22497eb3faa)
Change-Id: I0455871aef230371db5ecb1b2e6b1468e8a6d079
BUG: 1412119
Signed-off-by: N Balachandran <nbalacha@redhat.com>
Reviewed-on: https://review.gluster.org/16374
Smoke: Gluster Build System <jenkins@build.gluster.org>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
-rw-r--r-- | xlators/cluster/dht/src/dht-inode-read.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/dht-inode-read.c b/xlators/cluster/dht/src/dht-inode-read.c index 549f1b9ea7e..8abf0d59b88 100644 --- a/xlators/cluster/dht/src/dht-inode-read.c +++ b/xlators/cluster/dht/src/dht-inode-read.c @@ -839,6 +839,12 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, dht_set_local_rebalance (this, local, NULL, prebuf, postbuf, xdata); + if ((op_ret == -1) || IS_DHT_MIGRATION_PHASE2 (postbuf)) { + ret = dht_rebalance_complete_check (this, frame); + if (!ret) + return 0; + } + /* Check if the rebalance phase1 is true */ if (IS_DHT_MIGRATION_PHASE1 (postbuf)) { @@ -860,11 +866,6 @@ dht_fsync_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, } } - if (IS_DHT_MIGRATION_PHASE2 (postbuf)) { - ret = dht_rebalance_complete_check (this, frame); - if (!ret) - return 0; - } out: DHT_STRIP_PHASE1_FLAGS (postbuf); |