summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAravinda VK <avishwan@redhat.com>2015-02-04 23:08:31 +0530
committerVijay Bellur <vbellur@redhat.com>2015-05-03 11:10:44 -0700
commite4e8c378728da595d18d488b438662efc2fea844 (patch)
tree8411faf47f9074a41fc4d929c711bb14b0be59a7
parent63ff54cdced349c7beb4aa78a35b9d027310e757 (diff)
geo-rep: Re Enable ignore_deletes Option
If this option is set, Deletes will not be propogated to Slave. This option is applicable for UNLINK and RMDIR. gluster volume geo-replication <MASTER> <SLAVEHOST>::<SLAVEVOL> \ config ignore_deletes true Default value is false. PS: Use this option with caution, If you create the file in master with same path then it fails to sync to slave. Old file in Slave will have different GFID compared to New. BUG: 1217929 Change-Id: I1f7816d1ea36460a654873739d3fb1b6c13e0f8d Signed-off-by: Aravinda VK <avishwan@redhat.com> Reviewed-on: http://review.gluster.org/9583 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kotresh HR <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/10498 Tested-by: NetBSD Build System
-rw-r--r--geo-replication/syncdaemon/configinterface.py.in4
-rw-r--r--geo-replication/syncdaemon/master.py5
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-geo-rep.c8
3 files changed, 13 insertions, 4 deletions
diff --git a/geo-replication/syncdaemon/configinterface.py.in b/geo-replication/syncdaemon/configinterface.py.in
index 1c174b5b760..f8df49935f1 100644
--- a/geo-replication/syncdaemon/configinterface.py.in
+++ b/geo-replication/syncdaemon/configinterface.py.in
@@ -60,6 +60,10 @@ CONFIGS = (
"working_dir",
"@localstatedir@/run/gluster/${mastervol}/${eSlave}",
"${iprefix}/lib/misc/glusterfsd/${mastervol}/${eSlave}"),
+ ("peersrx . .",
+ "ignore_deletes",
+ "true",
+ "false"),
)
diff --git a/geo-replication/syncdaemon/master.py b/geo-replication/syncdaemon/master.py
index 721ad9c3635..7707efa7cea 100644
--- a/geo-replication/syncdaemon/master.py
+++ b/geo-replication/syncdaemon/master.py
@@ -940,8 +940,9 @@ class GMasterChangelogMixin(GMasterCommon):
if pt in datas:
datas.remove(pt)
- purge_update()
- entries.append(edct(ty, gfid=gfid, entry=en))
+ if not boolify(gconf.ignore_deletes):
+ purge_update()
+ entries.append(edct(ty, gfid=gfid, entry=en))
elif ty in ['CREATE', 'MKDIR', 'MKNOD']:
entry_update()
# stat information present in the changelog itself
diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
index a190e1c8aea..708d6d3816d 100644
--- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
+++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c
@@ -51,6 +51,11 @@ struct gsync_config_opt_vals_ gsync_confopt_vals[] = {
.case_sensitive = _gf_false,
.values = {"true", "false", "0", "1", "yes", "no"}
},
+ {.op_name = "ignore_deletes",
+ .no_of_pos_vals = 6,
+ .case_sensitive = _gf_false,
+ .values = {"true", "false", "0", "1", "yes", "no"}
+ },
{.op_name = NULL,
},
};
@@ -63,7 +68,6 @@ static char *gsync_reserved_opts[] = {
"session-owner",
"state-socket-unencoded",
"socketdir",
- "ignore-deletes",
"local-id",
"local-path",
"slave-id",
@@ -5111,7 +5115,7 @@ create_conf_file (glusterd_conf_t *conf, char *conf_path)
/* ignore-deletes */
runinit_gsyncd_setrx (&runner, conf_path);
- runner_add_args (&runner, "ignore-deletes", "true", ".", ".", NULL);
+ runner_add_args (&runner, "ignore-deletes", "false", ".", ".", NULL);
RUN_GSYNCD_CMD;
/* special-sync-mode */