summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAnand Avati <avati@redhat.com>2013-03-24 12:19:56 -0700
committerAnand Avati <avati@redhat.com>2013-03-27 22:15:53 -0700
commitca10fdc81a72a71ac67ac9fc8c5ad5b92febd875 (patch)
tree7c8cef642d283bf3a132499a1c82f3351ced475f /tests
parent1f7dadccd45863ebea8f60339f297ac551e89899 (diff)
cluster/afr: ensure DATA operations are made durable before POST-OP
The changelogging scheme of AFR stores information about the state of all replicas in all replicas (in the extended attribute of the respective files on each server) in the form of 'pending counts' of operations (effectively "dirty flags"). These xattrs are blindly trusted while performing self-heal, and therefore utmost care has to be taken while updating and maintaing them. The most critical updation is the clearing of the pending counts corresponding to the *other* server in the changelog of a given server. Before clearing the pending count, we need durability guarantee of the write which was performed on the other server. To obtain such a guarantee, it may be necessary to explicitly introduce an fsync() phase (if the file itself wasn't already opened with O_SYNC). This patch introduces the detection of unstable stable writes on a file and issues explicit fsync() on the servers before performing the POST-OP clearing of pending flags. Change-Id: I2171b86a74ec91e40e5877eef0a4e7379578ecf7 BUG: 927146 Signed-off-by: Anand Avati <avati@redhat.com> Reviewed-on: http://review.gluster.org/4721 Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/bug-888174.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/bugs/bug-888174.t b/tests/bugs/bug-888174.t
index 6cf8d04ad7c..76ca3c961f4 100644
--- a/tests/bugs/bug-888174.t
+++ b/tests/bugs/bug-888174.t
@@ -36,14 +36,14 @@ inodelk_max_latency=$($CLI volume profile $V0 info | grep INODELK | awk 'BEGIN {
TEST [ -z $inodelk_max_latency ]
-TEST dd of=$M0/a if=/dev/urandom bs=1M count=10
+TEST dd of=$M0/a if=/dev/urandom bs=1M count=10 conv=fsync
#Check for no trace of pending changelog. Flush should make sure of it.
EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_0/a trusted.afr.$V0-client-0
EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_0/a trusted.afr.$V0-client-1
EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_1/a trusted.afr.$V0-client-0
EXPECT "0x000000000000000000000000" afr_get_changelog_xattr $B0/r2_1/a trusted.afr.$V0-client-1
-dd of=$M0/a if=/dev/urandom bs=1M count=1024 2>/dev/null &
+dd of=$M0/a if=/dev/urandom bs=1M count=1024 oflag=sync 2>/dev/null &
p=$!
#trigger graph switches, tests for fsync not leaving any pending flags
TEST $CLI volume set $V0 performance.quick-read off