From 20a665ae09eb8d5affb88fe409a6130a74bd0aad Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 21 Mar 2014 16:26:48 +1300 Subject: dsdb: Do not update notify_uSN until the transaction is genuinely committed to the DB Signed-off-by: Andrew Bartlett Change-Id: I734bc75ed348de8f0a5ff92e18e08de2340b8951 Reviewed-by: Stefan Metzmacher --- source4/dsdb/repl/replicated_objects.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index d1d69fa8f8..97b8b2a7a3 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -834,13 +834,6 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context *ldb, return WERR_FOOBAR; } - /* if this replication partner didn't need to be notified - before this transaction then it still doesn't need to be - notified, as the changes came from this server */ - if (seq_num2 > seq_num1 && seq_num1 <= *notify_uSN) { - *notify_uSN = seq_num2; - } - ret = ldb_transaction_commit(ldb); if (ret != LDB_SUCCESS) { /* restore previous schema */ @@ -854,6 +847,13 @@ WERROR dsdb_replicated_objects_commit(struct ldb_context *ldb, return WERR_FOOBAR; } + /* if this replication partner didn't need to be notified + before this transaction then it still doesn't need to be + notified, as the changes came from this server */ + if (seq_num2 > seq_num1 && seq_num1 <= *notify_uSN) { + *notify_uSN = seq_num2; + } + /* * Reset the Schema used by ldb. This will lead to * a schema cache being refreshed from database. -- cgit