This is an automated email from the git hooks/post-receive script.
lkrispen pushed a commit to branch 389-ds-base-1.3.8
in repository 389-ds-base.
commit 40178b51a64830d5405f20a244168afecd1b7542
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Thu May 17 10:31:58 2018 +0200
Ticket 49696: replicated operations should be serialized
Bug: there was a scenario where two threads could process replication operations
in parallel.
The reason was that for a new repl start request the repl conn flag is not
set and the
connection is made readable.
When the start repl op is finished, the flagi set, but in a small window the
supplier could
already have sent updates and more_data would trigger this thread also to
continue to process
repl operations.
Fix: In the situation where a thread successfully processed a start repl request
and just set the repl_conn
flag do not use more_data.
Reviewed by: Thierry, thanks
---
ldap/servers/slapd/connection.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 5ca32a3..b5030f0 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -1822,9 +1822,17 @@ connection_threadmain()
/* If we're in turbo mode, we keep our reference to the connection alive
*/
/* can't use the more_data var because connection could have changed in
another thread */
- more_data = conn_buffered_data_avail_nolock(conn, &conn_closed) ? 1 : 0;
- slapi_log_err(SLAPI_LOG_CONNS, "connection_threadmain", "conn
%" PRIu64 " check more_data %d thread_turbo_flag %d\n",
- conn->c_connid, more_data, thread_turbo_flag);
+ slapi_log_err(SLAPI_LOG_CONNS, "connection_threadmain", "conn
%" PRIu64 " check more_data %d thread_turbo_flag %d"
+ "repl_conn_bef %d, repl_conn_now %d\n",
+ conn->c_connid, more_data, thread_turbo_flag,
+ replication_connection, conn->c_isreplication_session);
+ if (!replication_connection && conn->c_isreplication_session) {
+ /* it a connection that was just flagged as replication connection */
+ more_data = 0;
+ } else {
+ /* normal connection or already established replication connection */
+ more_data = conn_buffered_data_avail_nolock(conn, &conn_closed) ? 1 :
0;
+ }
if (!more_data) {
if (!thread_turbo_flag) {
/*
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.