summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl/drepl_service.h
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.h
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.h')
-rw-r--r--source4/dsdb/repl/drepl_service.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/source4/dsdb/repl/drepl_service.h b/source4/dsdb/repl/drepl_service.h
index a9eea30719..0f9684fa78 100644
--- a/source4/dsdb/repl/drepl_service.h
+++ b/source4/dsdb/repl/drepl_service.h
@@ -69,6 +69,9 @@ struct dreplsrv_partition_source_dsa {
struct repsFromToBlob _repsFromBlob;
struct repsFromTo1 *repsFrom1;
+ /* the last uSN when we sent a notify */
+ uint64_t notify_uSN;
+
/* the reference to the source_dsa and its outgoing connection */
struct dreplsrv_out_connection *conn;
};
@@ -107,6 +110,17 @@ struct dreplsrv_out_operation {
struct composite_context *creq;
};
+struct dreplsrv_notify_operation {
+ struct dreplsrv_notify_operation *prev, *next;
+
+ struct dreplsrv_service *service;
+ uint64_t uSN;
+
+ struct dreplsrv_partition_source_dsa *source_dsa;
+
+ struct composite_context *creq;
+};
+
struct dreplsrv_service {
/* the whole drepl service is in one task */
struct task_server *task;
@@ -150,6 +164,23 @@ struct dreplsrv_service {
struct tevent_timer *te;
} periodic;
+ /* some stuff for notify processing */
+ struct {
+ /*
+ * the interval between notify runs
+ */
+ uint32_t interval;
+
+ /*
+ * the timestamp for the next event,
+ * this is the timstamp passed to event_add_timed()
+ */
+ struct timeval next_event;
+
+ /* here we have a reference to the timed event the schedules the notifies */
+ struct tevent_timer *te;
+ } notify;
+
/*
* the list of partitions we need to replicate
*/
@@ -166,6 +197,12 @@ struct dreplsrv_service {
/* the list of pending operations */
struct dreplsrv_out_operation *pending;
+
+ /* the list of pending notify operations */
+ struct dreplsrv_notify_operation *notifies;
+
+ /* an active notify operation */
+ struct dreplsrv_notify_operation *n_current;
} ops;
};