[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Nov 5 01:16:02 MDT 2010


The branch, master has been updated
       via  578a37e s4:dsdb/drepl_notify: reuse dreplsrv_notify_operation structures
      from  211f6d5 s4/auth: Add logon_parameters to authenticate_username_pw

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


- Log -----------------------------------------------------------------
commit 578a37e806ff1c1194a694dc39f65fdd1cbf7b11
Author: Stefan Metzmacher <metze at samba.org>
Date:   Thu Nov 4 18:07:18 2010 +0100

    s4:dsdb/drepl_notify: reuse dreplsrv_notify_operation structures
    
    Otherwise we'll requeue the same notify events on and on.
    
    (gdb) p *((struct dreplsrv_service *) 0x1b52190)->ops.notifies
    $8 = {prev = 0xe4cb30, next = 0x1a25440, service = 0x1b52190, uSN = 123905,
    source_dsa = 0x164c100, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *) 0x1b52190)->ops.notifies->next
    $9 = {prev = 0x80e000, next = 0x1b7bf70, service = 0x1b52190, uSN = 123589,
    source_dsa = 0x1a2d930, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *) 0x1b52190)->ops.notifies->next->next
    $10 = {prev = 0x1a25440, next = 0x1d0c310, service = 0x1b52190, uSN = 1587,
    source_dsa = 0x13d3210, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *) 0x1b52190)->ops.notifies->next->next->next
    $11 = {prev = 0x1b7bf70, next = 0x1ba1420, service = 0x1b52190, uSN = 123905,
    source_dsa = 0x164c100, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *)
    0x1b52190)->ops.notifies->next->next->next->next
    $12 = {prev = 0x1d0c310, next = 0x1c43510, service = 0x1b52190, uSN = 123589,
    source_dsa = 0x1a2d930, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *)
    0x1b52190)->ops.notifies->next->next->next->next->next
    $13 = {prev = 0x1ba1420, next = 0xed97b0, service = 0x1b52190, uSN = 1587,
    source_dsa = 0x13d3210, is_urgent = false, replica_flags = 29}
    (gdb) p *((struct dreplsrv_service *)
    0x1b52190)->ops.notifies->next->next->next->next->next->next
    $14 = {prev = 0x1c43510, next = 0xe4ce80, service = 0x1b52190, uSN = 123905,
    source_dsa = 0x164c100, is_urgent = false, replica_flags = 29}
    
    We can reuse this operations, while they're not yet started.
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Fri Nov  5 07:15:04 UTC 2010 on sn-devel-104

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

Summary of changes:
 source4/dsdb/repl/drepl_notify.c |   22 ++++++++++++++++++++++
 1 files changed, 22 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/repl/drepl_notify.c b/source4/dsdb/repl/drepl_notify.c
index 5d4ed6a..836509b 100644
--- a/source4/dsdb/repl/drepl_notify.c
+++ b/source4/dsdb/repl/drepl_notify.c
@@ -305,6 +305,28 @@ static WERROR dreplsrv_schedule_notify_sync(struct dreplsrv_service *service,
 		return WERR_DS_UNAVAILABLE;
 	}
 
+	/* first try to find an existing notify operation */
+	for (op = service->ops.notifies; op; op = op->next) {
+		if (op->source_dsa != s) {
+			continue;
+		}
+
+		if (op->is_urgent != is_urgent) {
+			continue;
+		}
+
+		if (op->replica_flags != replica_flags) {
+			continue;
+		}
+
+		if (op->uSN < uSN) {
+			op->uSN = uSN;
+		}
+
+		/* reuse the notify operation, as it's not yet started */
+		return WERR_OK;
+	}
+
 	op = talloc_zero(mem_ctx, struct dreplsrv_notify_operation);
 	W_ERROR_HAVE_NO_MEMORY(op);
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list