summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-06-13 16:23:21 +0530
committerXavi Hernandez <xhernandez@redhat.com>2019-06-21 11:09:32 +0000
commit2959fbfbb77e2b1b2ccbc90610f8ff9362109ae3 (patch)
treeb36d1413cad462067779d8a23d149c476dd11170 /tests/volume.rc
parent804de0be6f100ede12f6131d3320cf06a227f191 (diff)
posix/ctime: Fix ctime upgrade issue
Problem: On a EC volume, during upgrade from the older version where ctime feature is not enabled(or not present) to the newer version where the ctime feature is available (enabled default), the self heal hangs and doesn't complete. Cause: The ctime feature has both client side code (utime) and server side code (posix). The feature is driven from client. Only if the client side sets the time in the frame, should the server side sets the time attributes in xattr. But posix setattr/fseattr was not doing that. When one of the server nodes is updated, since ctime is enabled by default, it starts setting xattr on setattr/fseattr on the updated node/brick. On a EC volume the first two updated nodes(bricks) are not a problem because there are 4 other bricks with consistent data. However once the third brick is updated, the new attribute(mdata xattr) will cause an inconsistency on metadata on 3 bricks, which prevents the file to be repaired. Fix: Don't create mdata xattr with utimes/utimensat system call. Only update if already present. Change-Id: Ieacedecb8a738bb437283ef3e0f042fd49dc4c8c fixes: bz#1720201 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 6477dfb484f..85a2cb01727 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -944,3 +944,33 @@ function number_healer_threads_shd {
local pid=$(get_shd_mux_pid $1)
pstack $pid | grep $2 | wc -l
}
+
+function get_mtime {
+ local time=$(get-mdata-xattr -m $1)
+ if [ $time == "-1" ];
+ then
+ echo $(stat -c %Y $1)
+ else
+ echo $time
+ fi
+}
+
+function get_ctime {
+ local time=$(get-mdata-xattr -c $1)
+ if [ $time == "-1" ];
+ then
+ echo $(stat -c %Z $2)
+ else
+ echo $time
+ fi
+}
+
+function get_atime {
+ local time=$(get-mdata-xattr -a $1)
+ if [ $time == "-1" ];
+ then
+ echo $(stat -c %X $1)
+ else
+ echo $time
+ fi
+}