From e7e89c9ec8b56ad5a442ad105c0b05e674a591cd Mon Sep 17 00:00:00 2001 From: Sunny Kumar Date: Tue, 2 Apr 2019 12:38:09 +0530 Subject: geo-rep: Fix rename with existing destination with same gfid Problem: Geo-rep fails to sync the rename properly if destination exists. It results in source to be remained on slave causing more number of files on slave. Also heavy rename workload like logrotate caused lot of ESTALE errors Cause: Geo-rep fails to sync rename if destination exists if creation of source file also falls into single batch of changelogs being processed. This is because, after fixing problematic gfids verifying from master, while re-processing original entries, CREATE also was re-processed causing more files on slave and rename to be failed. Solution: Entries need to be removed from retrial list after fixing problematic gfids on slave so that it's not re-created again on slave. Also treat ESTALE as EEXIST so that the error is properly handled verifying the op on master volume. Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 fixes: bz#1694820 Signed-off-by: Kotresh HR Signed-off-by: Sunny Kumar --- tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t | 5 +++++ tests/00-geo-rep/georep-basic-dr-rsync.t | 5 +++++ tests/00-geo-rep/georep-basic-dr-tarssh-arbiter.t | 5 +++++ tests/00-geo-rep/georep-basic-dr-tarssh.t | 5 +++++ 4 files changed, 20 insertions(+) (limited to 'tests/00-geo-rep') diff --git a/tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t b/tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t index eab12ee66a6..9e614beb8b6 100644 --- a/tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t +++ b/tests/00-geo-rep/georep-basic-dr-rsync-arbiter.t @@ -203,6 +203,11 @@ EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rsnapshot_data ${slave_mnt} TEST gluster volume geo-rep $master $slave config rsync-options "--whole-file" TEST "echo sampledata > $master_mnt/rsync_option_test_file" +#rename with existing destination case BUG:1694820 +TEST create_rename_with_existing_destination ${master_mnt} +#verify rename with existing destination case BUG:1694820 +EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rename_with_existing_destination ${slave_mnt} + #Verify arequal for whole volume EXPECT_WITHIN $GEO_REP_TIMEOUT 0 arequal_checksum ${master_mnt} ${slave_mnt} diff --git a/tests/00-geo-rep/georep-basic-dr-rsync.t b/tests/00-geo-rep/georep-basic-dr-rsync.t index 919c9d924ad..e719e5c3213 100644 --- a/tests/00-geo-rep/georep-basic-dr-rsync.t +++ b/tests/00-geo-rep/georep-basic-dr-rsync.t @@ -207,6 +207,11 @@ EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rsnapshot_data ${slave_mnt} TEST gluster volume geo-rep $master $slave config rsync-options "--whole-file" TEST "echo sampledata > $master_mnt/rsync_option_test_file" +#rename with existing destination case BUG:1694820 +TEST create_rename_with_existing_destination ${master_mnt} +#verify rename with existing destination case BUG:1694820 +EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rename_with_existing_destination ${slave_mnt} + #Verify arequal for whole volume EXPECT_WITHIN $GEO_REP_TIMEOUT 0 arequal_checksum ${master_mnt} ${slave_mnt} diff --git a/tests/00-geo-rep/georep-basic-dr-tarssh-arbiter.t b/tests/00-geo-rep/georep-basic-dr-tarssh-arbiter.t index 1726d0bb0d1..cb530adbe0e 100644 --- a/tests/00-geo-rep/georep-basic-dr-tarssh-arbiter.t +++ b/tests/00-geo-rep/georep-basic-dr-tarssh-arbiter.t @@ -202,6 +202,11 @@ EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_symlink_rename_mkdir_data ${slave_mnt}/s #rsnapshot usecase EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rsnapshot_data ${slave_mnt} +#rename with existing destination case BUG:1694820 +TEST create_rename_with_existing_destination ${master_mnt} +#verify rename with existing destination case BUG:1694820 +EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rename_with_existing_destination ${slave_mnt} + #Verify arequal for whole volume EXPECT_WITHIN $GEO_REP_TIMEOUT 0 arequal_checksum ${master_mnt} ${slave_mnt} diff --git a/tests/00-geo-rep/georep-basic-dr-tarssh.t b/tests/00-geo-rep/georep-basic-dr-tarssh.t index c5d16ac86b2..9e2f6135751 100644 --- a/tests/00-geo-rep/georep-basic-dr-tarssh.t +++ b/tests/00-geo-rep/georep-basic-dr-tarssh.t @@ -202,6 +202,11 @@ EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_hardlink_rename_data ${slave_mnt} #rsnapshot usecase EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rsnapshot_data ${slave_mnt} +#rename with existing destination case BUG:1694820 +TEST create_rename_with_existing_destination ${master_mnt} +#verify rename with existing destination case BUG:1694820 +EXPECT_WITHIN $GEO_REP_TIMEOUT 0 verify_rename_with_existing_destination ${slave_mnt} + #Verify arequal for whole volume EXPECT_WITHIN $GEO_REP_TIMEOUT 0 arequal_checksum ${master_mnt} ${slave_mnt} -- cgit