summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl/drepl_service.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-09-13 18:16:13 +1000
committerAndrew Tridgell <tridge@samba.org>2009-09-13 16:40:37 -0700
commit55a9ea2b33cbcd39ae44972b71922c9c87748d75 (patch)
treeb95d3b2aa1222f571aef83d10a48a71ab0d29e6d /source4/dsdb/repl/drepl_service.c
parent348efd5cbb2e7880671cbc75d01b92c4c9008d9e (diff)
downloadsamba-55a9ea2b33cbcd39ae44972b71922c9c87748d75.tar.gz
samba-55a9ea2b33cbcd39ae44972b71922c9c87748d75.tar.bz2
samba-55a9ea2b33cbcd39ae44972b71922c9c87748d75.zip
s4-repl: added a preiodic notification check to the repl task
The dreplsrv_notify code checks the partition uSN values every N seconds, and if one has changed then it sends a DsReplicaSync to all the replication partners listed in the repsTo attribute for the partition.
Diffstat (limited to 'source4/dsdb/repl/drepl_service.c')
-rw-r--r--source4/dsdb/repl/drepl_service.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/dsdb/repl/drepl_service.c b/source4/dsdb/repl/drepl_service.c
index eb49da3d41..cb415b65e6 100644
--- a/source4/dsdb/repl/drepl_service.c
+++ b/source4/dsdb/repl/drepl_service.c
@@ -196,6 +196,16 @@ static void dreplsrv_task_init(struct task_server *task)
return;
}
+ service->notify.interval = lp_parm_int(task->lp_ctx, NULL, "dreplsrv",
+ "notify_interval", 5); /* in seconds */
+ status = dreplsrv_notify_schedule(service, service->notify.interval);
+ if (!W_ERROR_IS_OK(status)) {
+ task_server_terminate(task, talloc_asprintf(task,
+ "dreplsrv: Failed to setup notify schedule: %s\n",
+ win_errstr(status)));
+ return;
+ }
+
irpc_add_name(task->msg_ctx, "dreplsrv");
IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICASYNC, drepl_replica_sync, service);