summaryrefslogtreecommitdiffstats
path: root/geo-replication/syncdaemon/master.py
diff options
context:
space:
mode:
authorSaravanakumar Arumugam <sarumuga@redhat.com>2015-10-14 11:49:49 +0530
committerVenky Shankar <vshankar@redhat.com>2015-10-26 05:00:14 -0700
commit6188b5fcebc56b3d8af1956beeec9988f3e8f268 (patch)
tree156e2111c94a75fb8ba7ec211f55047d8031e712 /geo-replication/syncdaemon/master.py
parent4f65f894ab1c19618383ba212dc0f0df48675823 (diff)
geo-rep: Avoid cold tier bricks during ENTRY operation
This is a series of patch 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. Now, once the file is demoted to COLD tier, any namespace operation carried out on the cold tier can be avoided as we directly RECORD the same in HOT tier. How? 1. Check whether the brick is cold tier and skip ENTRY operation. 2. Also, if it is cold tier brick, use Xsync(which is used during initial run). This will help in getting all cold tier bricks changes using File System crawl and helps in avoiding races with hot tier brick(which can happen if historychangelog used in cold tier brick). Dependent patches: 1. http://review.gluster.org/12239 2. http://review.gluster.org/12326 Change-Id: I7692b1dbb8813a7e253451bca02f8f09a5782dde BUG: 1266875 Signed-off-by: Saravanakumar Arumugam <sarumuga@redhat.com> Reviewed-on: http://review.gluster.org/12355 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Aravinda VK <avishwan@redhat.com>
Diffstat (limited to 'geo-replication/syncdaemon/master.py')
-rw-r--r--geo-replication/syncdaemon/master.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 407e4b29580..b2cfb8531d1 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -809,6 +809,13 @@ class GMasterChangelogMixin(GMasterCommon):
et = e[self.IDX_START:self.IDX_END] # entry type
ec = e[self.IDX_END:].split(' ') # rest of the bits
+ # skip ENTRY operation if cold tier brick
+ if self.name == 'live_changelog':
+ if boolify(gconf.is_coldtier) and et == self.TYPE_ENTRY:
+ logging.debug('skip ENTRY op: %s if cold tier brick'
+ % (ec[self.POS_TYPE]))
+ continue
+
if et == self.TYPE_ENTRY:
# extract information according to the type of
# the entry operation. create(), mkdir() and mknod()
@@ -1120,6 +1127,7 @@ class GMasterChangelogMixin(GMasterCommon):
self.changelog_done_func = self.changelog_agent.done
self.processed_changelogs_dir = os.path.join(self.setup_working_dir(),
".processed")
+ self.name = "live_changelog"
self.status = status
@@ -1132,6 +1140,7 @@ class GMasterChangeloghistoryMixin(GMasterChangelogMixin):
self.history_turns = 0
self.processed_changelogs_dir = os.path.join(self.setup_working_dir(),
".history/.processed")
+ self.name = "history_changelog"
self.status = status
def crawl(self):
@@ -1226,6 +1235,7 @@ class GMasterXsyncMixin(GMasterChangelogMixin):
self.tempdir = self.setup_working_dir()
self.tempdir = os.path.join(self.tempdir, 'xsync')
self.processed_changelogs_dir = self.tempdir
+ self.name = "xsync"
logging.info('xsync temp directory: %s' % self.tempdir)
try:
os.makedirs(self.tempdir)