[PATCH] Eliminate an explicit nested event loop in repl_meta_data

Andrew Bartlett abartlet at samba.org
Mon Apr 14 23:50:29 MDT 2014

For reasons that are not entirely clear, at a Samba 4.1.0 deployment the
drepl server managed to get stuck in this event loop:

static int replmd_replicated_handle_rename(struct
replmd_replicated_request *ar,
					   struct ldb_message *msg,
					   struct ldb_request *parent)

	ret = ldb_next_request(ar->module, req);

	if (ret == LDB_SUCCESS) {
		ret = ldb_wait(req->handle, LDB_WAIT_ALL);

There isn't anything special about this as far as I can see - and is
essentially the same as the dsdb_module_*() functions we use everywhere,
but I've written up this patch to try and remove this particular loop.

Your careful consideration would be most appreciated.  The patch is
rebased on master, but was clean on 4.1 as well. 

More broadly, I have access the the logs and backtrace, and it really is
stuck here, but I can't figure out both how it fails (the subtree_rename
checks fail, despite this being a DRS replication and so running under
relax), and how come the loop doesn't end. 

One thing we might wish to consider is not using the global event
context in LDB when we have a transaction active.  This will almost
never give the semantics we want, and is quite prone to deadlocks.  We
could have ldb_transaction_start() override the event loop with a newly
created one, and put it back when the transaction is closed, therefore
ensuring only ldb events fire when we use LDB.

The negative impact of this should be minimal, limited only to less
'async' on the experimental work on the LDAP backend, which will need to
solve these issues properly before it becomes real. 


Andrew Bartlett

Andrew Bartlett
Authentication Developer, Samba Team  http://samba.org
Samba Developer, Catalyst IT          http://catalyst.net.nz/services/samba

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-dsdb-Handle-renames-and-conflicts-from-renames-async.patch
Type: text/x-patch
Size: 12887 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140415/b08c58a5/attachment.bin>

More information about the samba-technical mailing list