summaryrefslogtreecommitdiffstats
path: root/geo-replication
diff options
context:
space:
mode:
authorSaravanakumar Arumugam <sarumuga@redhat.com>2015-10-09 20:29:30 +0530
committerVenky Shankar <vshankar@redhat.com>2015-10-29 00:18:27 -0700
commit86b6d13e42c2e0de92a2a2099644fbb75308dd12 (patch)
treee8554a5caf278e11ecde6d55232e7b98e972f670 /geo-replication
parent7598d5e1466971e02823a9f663059f6e18b8361a (diff)
geo-rep: Add data operation if mknod with tier attribute
This is a series of patches which aims to fix geo-replication in a Tiering Volume. Problem: Consider, a file is placed in volume initially and then hot tier is attached. During any operation on the file, due to lookup a linkto file is created in hot tier. Now, any namespace operation carried out on the file is recorded in both cold and hot tier. There is a room for races when both changelogs are replayed. Solution: So, We are going to replay (namespace related)operations only in the hot tier. Why? a. If the file is directly placed in Hot tier, all fops will be recorded in HOT tier. b. If the file is already present in Cold tier, and if any fop is carried out, it creates linkto file in Hot tier. Now, operations like UNLINK, RENAME are captured in Hot tier(by means of linkto file). This way, we can get both tier's operation in HOT tier itself. But, We may miss initial Data sync immediately after creating the file as it is only recording MKNOD. So, if MKNOD encountered with sticky bit set, queue DATA operation for the corresponding gfid. (This is addressed here in this patch) So, If tier-gfid linkto is set, we need to record the corresponding MKNOD. Earlier this was avoided as it was set as INTERNAL fop. (This changelog related changes are addressed in the patch: - http://review.gluster.org/12417) Change-Id: I2fa84cfa2b0f86506c3d15d484138ab9651e4f83 BUG: 1275173 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/12326 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-by: Aravinda VK <avishwan@redhat.com> (cherry picked from commit ffc39c9d8807464b5c78959bc43dc12b22f5a37b) Reviewed-on: http://review.gluster.org/12427 Reviewed-by: Venky Shankar <vshankar@redhat.com>
Diffstat (limited to 'geo-replication')
-rw-r--r--geo-replication/syncdaemon/master.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 1bc2450..407e4b2 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -842,6 +842,15 @@ class GMasterChangelogMixin(GMasterCommon):
entries.append(edct(ty, gfid=gfid, entry=en,
mode=int(ec[2]),
uid=int(ec[3]), gid=int(ec[4])))
+
+ # Special case: add DATA in case of tier linkto file,
+ # Here, we have the assumption that only tier-gfid.linkto
+ # causes this mknod
+ if ty in ['MKNOD']:
+ mode = int(ec[2])
+ if mode & 01000:
+ datas.add(os.path.join(pfx, ec[0]))
+
elif ty == "RENAME":
go = os.path.join(pfx, gfid)
st = lstat(go)