summaryrefslogtreecommitdiffstats
path: root/tests/geo-rep.rc
diff options
context:
space:
mode:
authorSunny Kumar <sunkumar@redhat.com>2019-04-02 12:38:09 +0530
committerAmar Tumballi <amarts@redhat.com>2019-05-17 07:47:53 +0000
commit219c9bc92c721d49de78fd5a4d98aca7d3c66ad4 (patch)
tree78a76df59a37b81de30231ad154a3ca7ca690d0b /tests/geo-rep.rc
parent4a4710b81000e330fc655d95f068ea1112f1f4fb (diff)
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. Backport of: > Patch: https://review.gluster.org/22519/ > Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 > BUG: 1694820 > Signed-off-by: Kotresh HR <khiremat@redhat.com> > Signed-off-by: Sunny Kumar <sunkumar@redhat.com> Change-Id: I50cf289e06b997adddff0552bf2466d9201dd1f9 fixes: bz#1709734 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'tests/geo-rep.rc')
-rw-r--r--tests/geo-rep.rc36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/geo-rep.rc b/tests/geo-rep.rc
index d72312956b3..e357ba8a812 100644
--- a/tests/geo-rep.rc
+++ b/tests/geo-rep.rc
@@ -403,3 +403,39 @@ function check_slave_read_only()
gluster volume info $1 | grep 'features.read-only: on'
echo $?
}
+
+function create_rename_with_existing_destination()
+{
+ dir=$1/rename_with_existing_destination
+ mkdir $dir
+ for i in {1..5}
+ do
+ echo "Data_set$i" > $dir/data_set$i
+ mv $dir/data_set$i $dir/data_set -f
+ done
+}
+
+function verify_rename_with_existing_destination()
+{
+ dir=$1/rename_with_existing_destination
+
+ if [ ! -d $dir ]; then
+ echo 1
+ elif [ ! -f $dir/data_set ]; then
+ echo 2
+ elif [ -f $dir/data_set1 ]; then
+ echo 3
+ elif [ -f $dir/data_set2 ]; then
+ echo 4
+ elif [ -f $dir/data_set3 ]; then
+ echo 5
+ elif [ -f $dir/data_set4 ]; then
+ echo 6
+ elif [ -f $dir/data_set5 ]; then
+ echo 7
+ elif test "XData_set5" != "X$(cat $dir/data_set)"; then
+ echo 8
+ else
+ echo 0
+ fi
+}