summaryrefslogtreecommitdiffstats
path: root/tests/volume.rc
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-07-29 18:30:42 +0530
committerKotresh HR <khiremat@redhat.com>2019-09-16 10:54:21 +0000
commit0a2870b33d5d0a3cded21ac1e3071e3fde81bbb6 (patch)
tree52e9ca3824263f6bfb4830bd7df02c40a80cc0c6 /tests/volume.rc
parenta2201d804d8e76ca82a9d086a6ee545cb26228a1 (diff)
ctime/rebalance: Heal ctime xattr on directory during rebalance
After add-brick and rebalance, the ctime xattr is not present on rebalanced directories on new brick. This patch fixes the same. Note that ctime still doesn't support consistent time across distribute sub-volume. This patch also fixes the in-memory inconsistency of time attributes when metadata is self healed. Backport of: > Patch: https://review.gluster.org/23127/ > Change-Id: Ia20506f1839021bf61d4753191e7dc34b31bb2df > BUG: 1734026 > Signed-off-by: Kotresh HR <khiremat@redhat.com> (cherry picked from commit 304640e55c0f3c6d15f4e230dc6376e4f5020fea) Change-Id: Ia20506f1839021bf61d4753191e7dc34b31bb2df Signed-off-by: Kotresh HR <khiremat@redhat.com> fixes: bz#1752429
Diffstat (limited to 'tests/volume.rc')
-rw-r--r--tests/volume.rc15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/volume.rc b/tests/volume.rc
index 85a2cb01727..9f2356aa4e8 100644
--- a/tests/volume.rc
+++ b/tests/volume.rc
@@ -387,6 +387,19 @@ function get_gfid2path {
getfattr -h --only-values -n glusterfs.gfidtopath $path 2>/dev/null
}
+function get_mdata {
+ local path=$1
+ getfattr -h -e hex -n trusted.glusterfs.mdata $path 2>/dev/null | grep "trusted.glusterfs.mdata" | cut -f2 -d'='
+}
+
+function get_mdata_count {
+ getfattr -d -m . -e hex $@ 2>/dev/null | grep mdata | wc -l
+}
+
+function get_mdata_uniq_count {
+ getfattr -d -m . -e hex $@ 2>/dev/null | grep mdata | uniq | wc -l
+}
+
function get_xattr_key {
local key=$1
local path=$2
@@ -959,7 +972,7 @@ function get_ctime {
local time=$(get-mdata-xattr -c $1)
if [ $time == "-1" ];
then
- echo $(stat -c %Z $2)
+ echo $(stat -c %Z $1)
else
echo $time
fi