summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2019-07-29 16:22:10 +0530
committerAmar Tumballi <amarts@redhat.com>2019-08-01 02:59:08 +0000
commitd7e449b0da35a30af876aef1bea1fb096d0c06dc (patch)
tree34a12d42cb606589d37326370883be6f27e033b6 /xlators/cluster/afr
parent7124fc6d01aa23e9a218d0ce608242d0ae320193 (diff)
posix/ctime: Fix race during lookup ctime xattr heal
Problem: Ctime heals the ctime xattr ("trusted.glusterfs.mdata") in lookup if it's not present. In a multi client scenario, there is a race which results in updating the ctime xattr to older value. e.g. Let c1 and c2 be two clients and file1 be the file which doesn't have the ctime xattr. Let the ctime of file1 be t1. (from backend, ctime heals time attributes from backend when not present). Now following operations are done on mount c1 -> ls -l /mnt/file1 | c2 -> ls -l /mnt/file1;echo "append" >> /mnt/file1; The race is that the both c1 and c2 didn't fetch the ctime xattr in lookup, so both of them tries to heal ctime to time 't1'. If c2 wins the race and appends the file before c1 heals it, it sets the time to 't1' and updates it to 't2' (because of append). Now c1 proceeds to heal and sets it to 't1' which is incorrect. Solution: Compare the times during heal and only update the larger time. This is the general approach used in ctime feature but got missed with healing legacy files. fixes: bz#1734299 Change-Id: I930bda192c64c3d49d0aed431ce23d3bc57e51b7 Signed-off-by: Kotresh HR <khiremat@redhat.com>
Diffstat (limited to 'xlators/cluster/afr')
0 files changed, 0 insertions, 0 deletions