Thursday, September 6, 2018

[389-commits] [389-ds-base] 01/01: Ticket 49696: replicated operations should be serialized

This is an automated email from the git hooks/post-receive script.

mreynolds pushed a commit to branch 389-ds-base-1.3.6
in repository 389-ds-base.

commit c154889636285c93463dec32ca982d81103ba077
Author: Mark Reynolds <mreynolds@redhat.com>
Date: Thu Sep 6 12:35:59 2018 -0400

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: ?
---
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 c1b4478..6991fbd 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -1819,9 +1819,17 @@ done:

/* 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.
_______________________________________________
389-commits mailing list -- 389-commits@lists.fedoraproject.org
To unsubscribe send an email to 389-commits-leave@lists.fedoraproject.org
Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/389-commits@lists.fedoraproject.org

No comments:

Post a Comment