changeset 19953:a502d38e7b70

director: Fixed user weakness getting stuck if multiple directors set user weak simultaneously
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 24 Mar 2016 09:36:14 +0900
parents 23e80adaf2ef
children 82ffadc8c4d7
files src/director/director-connection.c
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/director/director-connection.c	Wed Mar 23 23:33:49 2016 +0900
+++ b/src/director/director-connection.c	Thu Mar 24 09:36:14 2016 +0900
@@ -824,9 +824,16 @@
 		return TRUE;
 	}
 
-	if (ret == 0)
-		;
-	else if (dir_host == conn->dir->self_host) {
+	if (ret == 0) {
+		/* First time we're seeing this - forward it to others also.
+		   We'll want to do it even if the user was already marked as
+		   weak, because otherwise if two directors mark the user weak
+		   at the same time both the USER-WEAK notifications reach
+		   only half the directors until they collide and neither one
+		   finishes going through the whole ring marking the user
+		   non-weak. */
+		weak_forward = TRUE;
+	} else if (dir_host == conn->dir->self_host) {
 		/* We originated this USER-WEAK request. The entire ring has seen
 		   it and there weren't any conflicts. Make the user non-weak. */
 		dir_debug("user refresh: %u Our USER-WEAK seen by the entire ring",