[SCM] Samba Shared Repository - branch master updated - tevent-0-9-8-257-ga8ab1e2

Andrew Tridgell tridge at samba.org
Fri Sep 11 21:20:07 MDT 2009


The branch, master has been updated
       via  a8ab1e2570ac2a2e772295cd0cc46b7e60398043 (commit)
       via  493166b0094b973f7ed6fa98ed66eb0ffebc1447 (commit)
       via  0819e79c4fdbd937e4b9516a1ff2ed8439cc8830 (commit)
       via  b00518cf7a9d82e92309c66462f7049e185342c5 (commit)
      from  733fa19bc160b3aecfa15e0475042388e853969d (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit a8ab1e2570ac2a2e772295cd0cc46b7e60398043
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sat Sep 12 13:06:32 2009 +1000

    s4-drs: also fill in tmp_highest_usn
    
    Without this the client will not update its repsFrom highest_usn values

commit 493166b0094b973f7ed6fa98ed66eb0ffebc1447
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sat Sep 12 12:42:40 2009 +1000

    s4-drs: return objects with uSN > highest_usn
    
    When the client tells us the highest_usn they have is N, then we want
    to send them objects with usn>N, not>=N, as otherwise we end up
    sending them the same object (the one with the highest uSN) again and
    again.

commit 0819e79c4fdbd937e4b9516a1ff2ed8439cc8830
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sat Sep 12 12:08:34 2009 +1000

    s4-drs: spelling fix, and simpler search expression
    
    uSNChanged>=N is good enough, and offers a possibility of a simple
    optimisation where the partition module could look for that expression
    and check the partitions sequence number, then avoid searching a
    partition that doesn't have any records with a larger uSN.

commit b00518cf7a9d82e92309c66462f7049e185342c5
Author: Andrew Tridgell <tridge at samba.org>
Date:   Sat Sep 12 12:07:06 2009 +1000

    s4-repl: don't be too eager to allocate new sequence numbers
    
    we only need to allocate a new sequence number when
    replPropertyMetaData is changing or being created on an object

-----------------------------------------------------------------------

Summary of changes:
 source4/dsdb/samdb/ldb_modules/repl_meta_data.c |   16 +++++++++-------
 source4/rpc_server/drsuapi/getncchanges.c       |   13 +++++++++----
 2 files changed, 18 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 621f830..2a16c2b 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -964,11 +964,6 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
 		}
 	}
 
-	ret = ldb_sequence_number(ldb, LDB_SEQ_NEXT, &seq_num);
-	if (ret != LDB_SUCCESS) {
-		return replmd_replicated_request_error(ar, ret);
-	}
-
 	/* find existing meta data */
 	omd_value = ldb_msg_find_ldb_val(ar->search_msg, "replPropertyMetaData");
 	if (omd_value) {
@@ -1003,8 +998,6 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
 	for (i=0; i < rmd->ctr.ctr1.count; i++) {
 		bool found = false;
 
-		rmd->ctr.ctr1.array[i].local_usn = seq_num;
-
 		for (j=0; j < ni; j++) {
 			int cmp;
 
@@ -1079,6 +1072,15 @@ static int replmd_replicated_apply_merge(struct replmd_replicated_request *ar)
 	ldb_debug(ldb, LDB_DEBUG_TRACE, "replmd_replicated_apply_merge[%u]: replace %u attributes\n",
 		  ar->index_current, msg->num_elements);
 
+	ret = ldb_sequence_number(ldb, LDB_SEQ_NEXT, &seq_num);
+	if (ret != LDB_SUCCESS) {
+		return replmd_replicated_request_error(ar, ret);
+	}
+
+	for (i=0; i<ni; i++) {
+		nmd.ctr.ctr1.array[i].local_usn = seq_num;
+	}
+
 	/*
 	 * when we know that we'll modify the record, add the whenChanged, uSNChanged
 	 * and replPopertyMetaData attributes
diff --git a/source4/rpc_server/drsuapi/getncchanges.c b/source4/rpc_server/drsuapi/getncchanges.c
index 725a380..4dce07e 100644
--- a/source4/rpc_server/drsuapi/getncchanges.c
+++ b/source4/rpc_server/drsuapi/getncchanges.c
@@ -315,8 +315,8 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
 	ncRoot_dn = ldb_dn_new(mem_ctx, sam_ctx, ncRoot->dn);
 	ret = drsuapi_search_with_extended_dn(sam_ctx, mem_ctx, &site_res,
 					      ncRoot_dn, LDB_SCOPE_SUBTREE, attrs,
-					      "(&(uSNChanged>=%llu)(objectClass=*))", 
-					      (unsigned long long)r->in.req->req8.highwatermark.highest_usn);
+					      "uSNChanged>=%llu", 
+					      (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1));
 	if (ret != LDB_SUCCESS) {
 		return WERR_DS_DRA_INTERNAL_ERROR;
 	}
@@ -363,6 +363,7 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
 
 		uSN = ldb_msg_find_attr_as_int(site_res->msgs[i], "uSNChanged", -1);
 		if (uSN > r->out.ctr->ctr6.new_highwatermark.highest_usn) {
+			r->out.ctr->ctr6.new_highwatermark.tmp_highest_usn = uSN;
 			r->out.ctr->ctr6.new_highwatermark.highest_usn = uSN;
 		}
 
@@ -390,9 +391,13 @@ WERROR dcesrv_drsuapi_DsGetNCChanges(struct dcesrv_call_state *dce_call, TALLOC_
 	}
 
 
-	DEBUG(4,("DsGetNSChanges with uSNChanged >= %llu on %s gave %u objects\n", 
-		 (unsigned long long)r->in.req->req8.highwatermark.highest_usn,
+	DEBUG(4,("DsGetNCChanges with uSNChanged >= %llu on %s gave %u objects\n", 
+		 (unsigned long long)(r->in.req->req8.highwatermark.highest_usn+1),
 		 ncRoot->dn, r->out.ctr->ctr6.object_count));
 
+	if (r->out.ctr->ctr6.object_count <= 10 && DEBUGLVL(6)) {
+		NDR_PRINT_FUNCTION_DEBUG(drsuapi_DsGetNCChanges, NDR_IN|NDR_OUT, r);
+	}
+
 	return WERR_OK;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list