Blob Blame History Raw
From f37ec5bcb6391ed5b6e3113667d2c6f19eb12fdf Mon Sep 17 00:00:00 2001
From: Kotresh HR <khiremat@redhat.com>
Date: Tue, 23 Jun 2015 18:28:56 +0530
Subject: [PATCH 135/190] geo-rep: Fix geo-rep fanout setup with meta volume

Lock filename was formed with 'master volume id'
and 'subvol number'. Hence multiple slaves try
acquiring lock on same file and become PASSIVE
ending up not syncing data. Using 'slave volume id'
in lock filename will fix the issue making lock
file unique across different slaves.

BUG: 1234419
Change-Id: I366fc746f0f745b9a4590bb41839900c0a7b7071
Reviewed-on: http://review.gluster.org/11367
Reviewed-on: http://review.gluster.org/11366
Reviewed-by: Aravinda VK <avishwan@redhat.com>
Signed-off-by: Kotresh HR <khiremat@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/51566
Reviewed-by: Venky Shankar <vshankar@redhat.com>
Tested-by: Venky Shankar <vshankar@redhat.com>
---
 geo-replication/syncdaemon/master.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index e05dc37..dc54de3 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -442,8 +442,8 @@ class GMasterCommon(object):
 
     def mgmt_lock(self):
         """Take management volume lock """
-        bname = str(self.uuid) + "_subvol_" + str(gconf.subvol_num) \
-            + ".lock"
+        bname = str(self.uuid) + "_" + str(gconf.slave_id) + "_subvol_" \
+            + str(gconf.subvol_num) + ".lock"
         mgmt_lock_dir = os.path.join(gconf.meta_volume_mnt, "geo-rep")
         path = os.path.join(mgmt_lock_dir, bname)
         logging.debug("lock_file_path: %s" % path)
-- 
1.7.1