[PATCH] Fix BAD_NET_RESP error in DsReplicaSync

Andrew Bartlett abartlet at samba.org
Sat Jul 22 10:29:25 UTC 2017

This error has been plaguing out tests for a while making our
replication tests flap.

I got it locally and with a network trace, which made it clear the
issue is a lack of mutual exclusion between outbound GetNCChanges and
DsReplicaSync operations.

This patch fixes that.

Please review.  I have it under a few private autobuilds just to be
sure.  (Or more likely, to collect every other flapping test...)

Andrew Bartlett
Andrew Bartlett                       http://samba.org/~abartlet/
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba
-------------- next part --------------
From f816af781a2f109ab7a7e9ea5de4115059649821 Mon Sep 17 00:00:00 2001
From: Andrew Bartlett <abartlet at samba.org>
Date: Sat, 22 Jul 2017 22:00:59 +1200
Subject: [PATCH] s4-drepl: Block GetNCChanges during a DsReplicaSync

If we do not block these, we can get RPC faults
DsReplicaSync call as there are two outstanding requests on the wire
at the one time.

We will get to the next operation as soon as this is finished
when we call run_pending_ops().

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12926

Signed-off-by: Andrew Bartlett <abartlet at samba.org>
 source4/dsdb/repl/drepl_out_pull.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/source4/dsdb/repl/drepl_out_pull.c b/source4/dsdb/repl/drepl_out_pull.c
index 8af6412..8b8ecd9 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -198,7 +198,7 @@ void dreplsrv_run_pull_ops(struct dreplsrv_service *s)
 	struct tevent_req *subreq;
 	WERROR werr;
-	if (s->ops.current) {
+	if (s->ops.n_current || s->ops.current) {
 		/* if there's still one running, we're done */

More information about the samba-technical mailing list