diff options
author | Stefan Metzmacher <metze@samba.org> | 2007-02-20 14:56:45 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:39 -0500 |
commit | e0b1a83dd6c177d7e61c899a2ce4dad11ded9c49 (patch) | |
tree | 84c7d4e77dc8ebd5b3eebeb29ef7e2127a84fdfe /source4 | |
parent | c005b91adb6d9e6f4902af114cb0e623be814789 (diff) | |
download | samba-e0b1a83dd6c177d7e61c899a2ce4dad11ded9c49.tar.gz samba-e0b1a83dd6c177d7e61c899a2ce4dad11ded9c49.tar.bz2 samba-e0b1a83dd6c177d7e61c899a2ce4dad11ded9c49.zip |
r21465: the LDAP-UPTODATEVECTOR test shows that the replUpToDateVector
doesn't contain an entry for the local invocation_id
metze
(This used to be commit 4bd0ddeb80b0a6695a457434594c0240c8880d9f)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 78e7aca92f..51b6612236 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -1233,11 +1233,11 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a /* * the new uptodateness vector will at least - * contain 2 entries, one for the source_dsa and one the local server + * contain 1 entry, one for the source_dsa * * plus optional values from our old vector and the one from the source_dsa */ - nuv.ctr.ctr2.count = 2 + ouv.ctr.ctr2.count; + nuv.ctr.ctr2.count = 1 + ouv.ctr.ctr2.count; if (ruv) nuv.ctr.ctr2.count += ruv->count; nuv.ctr.ctr2.cursors = talloc_array(ar->sub.mem_ctx, struct drsuapi_DsReplicaCursor2, @@ -1250,10 +1250,19 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a ni++; } + /* get our invocation_id if we have one already attached to the ldb */ + our_invocation_id = samdb_ntds_invocation_id(ar->module->ldb); + /* merge in the source_dsa vector is available */ for (i=0; (ruv && i < ruv->count); i++) { found = false; + if (our_invocation_id && + GUID_equal(&ruv->cursors[i].source_dsa_invocation_id, + our_invocation_id)) { + continue; + } + for (j=0; j < ni; j++) { if (!GUID_equal(&ruv->cursors[i].source_dsa_invocation_id, &nuv.ctr.ctr2.cursors[j].source_dsa_invocation_id)) { @@ -1317,41 +1326,6 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a } /* - * merge our own current values if we have a invocation_id already - * attached to the ldb - */ - our_invocation_id = samdb_ntds_invocation_id(ar->module->ldb); - if (our_invocation_id) { - found = false; - for (j=0; j < ni; j++) { - if (!GUID_equal(our_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 it's our own entry - */ - nuv.ctr.ctr2.cursors[j].highest_usn = seq_num; - nuv.ctr.ctr2.cursors[j].last_sync_success = now; - break; - } - if (!found) { - /* - * here we update the highest_usn and last_sync_success time - * because it's our own entry - */ - nuv.ctr.ctr2.cursors[ni].source_dsa_invocation_id= *our_invocation_id; - nuv.ctr.ctr2.cursors[ni].highest_usn = seq_num; - nuv.ctr.ctr2.cursors[ni].last_sync_success = now; - ni++; - } - } - - /* * finally correct the size of the cursors array */ nuv.ctr.ctr2.count = ni; |