From 5c6e88320489d789fcd026bed72009b0806fe314 Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 8 Sep 2014 15:04:15 +0530 Subject: geo-rep/glusterd: Enable changelog and marker during geo-rep create. PROBLEM: Geo-rep misses few a files to sync when I/O happenned during geo-rep start. ANALYSES: To use the available changelogs to handle deletes/renames, 'xsync upper limit' is introduced which limits the xsync crawl till the changelog register time. But there is a small time interval between the changelog register time and the time changelog actually enabled. If there is I/O between this interval, it will not be synced through xsync as it is beyond changelog register time and not through changelog also as changelog is not actually enabled. SOLUTION: Enable changelog and marker during geo-rep create instead of geo-rep start so that entries are captured in changelog and above said interval is nullified. Change-Id: Ic5f0457a4b67a335cbbb37d34db5f8cb8bc901c4 BUG: 1139196 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/8650 Tested-by: Gluster Build System Reviewed-by: Aravinda VK Reviewed-by: Avra Sengupta Reviewed-by: Venky Shankar Tested-by: Venky Shankar --- xlators/mgmt/glusterd/src/glusterd-geo-rep.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'xlators/mgmt') diff --git a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c index a160314134e..8496327443c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-geo-rep.c +++ b/xlators/mgmt/glusterd/src/glusterd-geo-rep.c @@ -4566,16 +4566,6 @@ glusterd_op_gsync_set (dict_t *dict, char **op_errstr, dict_t *rsp_dict) is_force = dict_get_str_boolean (dict, "force", _gf_false); if (type == GF_GSYNC_OPTION_TYPE_START) { - - ret = glusterd_set_gsync_confs (volinfo); - if (ret != 0) { - gf_log (this->name, GF_LOG_WARNING, "marker/changelog" - " start failed"); - *op_errstr = gf_strdup ("Index initialization failed"); - ret = -1; - goto out; - } - /* Add slave to the dict indicating geo-rep session is running*/ ret = dict_set_dynstr_with_alloc (volinfo->gsync_active_slaves, key, "running"); @@ -5345,6 +5335,16 @@ create_essentials: goto out; } + /* Enable marker and changelog */ + ret = glusterd_set_gsync_confs (volinfo); + if (ret != 0) { + gf_log (this->name, GF_LOG_WARNING, "marker/changelog" + " start failed"); + *op_errstr = gf_strdup ("Index initialization failed"); + ret = -1; + goto out; + } + out: GF_FREE (slave_url_buf); gf_log ("", GF_LOG_DEBUG,"Returning %d", ret); -- cgit