summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-11-04 18:07:18 +0100
committerStefan Metzmacher <metze@samba.org>2010-11-05 07:15:04 +0000
commit578a37e806ff1c1194a694dc39f65fdd1cbf7b11 (patch)
tree774a57ce18b69d8d338373dba640832ce2f5d129
parent211f6d5f557c7a737f3ccc1b4ef592c0ea8d7b94 (diff)
downloadsamba-578a37e806ff1c1194a694dc39f65fdd1cbf7b11.tar.gz
samba-578a37e806ff1c1194a694dc39f65fdd1cbf7b11.tar.bz2
samba-578a37e806ff1c1194a694dc39f65fdd1cbf7b11.zip
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@samba.org> Autobuild-Date: Fri Nov 5 07:15:04 UTC 2010 on sn-devel-104
-rw-r--r--source4/dsdb/repl/drepl_notify.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/dsdb/repl/drepl_notify.c b/source4/dsdb/repl/drepl_notify.c
index 5d4ed6a59b..836509b3eb 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);