mirror of
https://github.com/samba-team/samba.git
synced 2025-02-09 09:57:48 +03:00
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
This commit is contained in:
parent
211f6d5f55
commit
578a37e806
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user