From b7f3b06af08de6eb13a4d535cf44765f849dd7d7 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 18 Dec 2012 14:46:23 +0100 Subject: [PATCH] s4:dsdb/repl_meta_data: don't merge highwatermark and uptodatevector (bug #9508) We should not do any magic regarding the highwatermark we got from the source dsa. We need to treat it as opaque and not try to be smart and merge it into the uptodatevector. Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett (cherry picked from commit 5ecbc892b5226d3d31da2c62ae5261a8d8a73072) --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 39 +------------------------ 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index b7d9248675c..30b2a42d130 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -4529,7 +4529,7 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a * * plus optional values from our old vector and the one from the source_dsa */ - nuv.ctr.ctr2.count = 1 + ouv.ctr.ctr2.count; + nuv.ctr.ctr2.count = ouv.ctr.ctr2.count; if (ruv) nuv.ctr.ctr2.count += ruv->count; nuv.ctr.ctr2.cursors = talloc_array(ar, struct drsuapi_DsReplicaCursor2, @@ -4577,43 +4577,6 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a } /* - * merge in the current highwatermark for the source_dsa - */ - found = false; - for (j=0; j < ni; j++) { - if (!GUID_equal(&ar->objs->source_dsa->source_dsa_invocation_id, - &nuv.ctr.ctr2.cursors[j].source_dsa_invocation_id)) { - continue; - } - - found = true; - - /* - * here we update the highest_usn and last_sync_success time - * because we're directly replicating from the source_dsa - * - * and use the tmp_highest_usn because this is what we have just applied - * to our ldb - */ - nuv.ctr.ctr2.cursors[j].highest_usn = ar->objs->source_dsa->highwatermark.tmp_highest_usn; - nuv.ctr.ctr2.cursors[j].last_sync_success = now; - break; - } - if (!found) { - /* - * here we update the highest_usn and last_sync_success time - * because we're directly replicating from the source_dsa - * - * and use the tmp_highest_usn because this is what we have just applied - * to our ldb - */ - nuv.ctr.ctr2.cursors[ni].source_dsa_invocation_id= ar->objs->source_dsa->source_dsa_invocation_id; - nuv.ctr.ctr2.cursors[ni].highest_usn = ar->objs->source_dsa->highwatermark.tmp_highest_usn; - nuv.ctr.ctr2.cursors[ni].last_sync_success = now; - ni++; - } - - /* * finally correct the size of the cursors array */ nuv.ctr.ctr2.count = ni; -- 2.11.4.GIT