mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_02_106-cleanup-stray-warning-messages-for-cmirror.patch

4c7ee1
commit 52aa3dbcabe85b38b51c68c27fb2397eb0fb1efd
4c7ee1
Author: Jonathan Brassow <jbrassow@redhat.com>
4c7ee1
Date:   Wed Mar 5 10:44:20 2014 -0600
4c7ee1
4c7ee1
    cmirrord:  Clean-up stray warning message
4c7ee1
    
4c7ee1
    cmirrord polls for messages on the kernel and cluster interfaces.
4c7ee1
    Sometimes it is possible for messages to be received on the cluster
4c7ee1
    interface and be waiting for processing while the node is in the
4c7ee1
    process of leaving the cluster group.  When this happens, the
4c7ee1
    messages received on the cluster interface are attempted to be
4c7ee1
    dispatched, but an error is returned because the connection is no
4c7ee1
    longer valid.  It is a harmless situation.  So, if we get the
4c7ee1
    specific error (CS_ERR_BAD_HANDLE) and we know that we have left
4c7ee1
    the group, then simply don't print the message.
4c7ee1
---
4c7ee1
 daemons/cmirrord/cluster.c | 13 ++++++++++---
4c7ee1
 1 file changed, 10 insertions(+), 3 deletions(-)
4c7ee1
4c7ee1
diff --git a/daemons/cmirrord/cluster.c b/daemons/cmirrord/cluster.c
4c7ee1
index fea739a..67391f1 100644
4c7ee1
--- a/daemons/cmirrord/cluster.c
4c7ee1
+++ b/daemons/cmirrord/cluster.c
4c7ee1
@@ -984,9 +984,16 @@ static int do_cluster_work(void *data __attribute__((unused)))
4c7ee1
 
4c7ee1
 	dm_list_iterate_items_safe(entry, tmp, &clog_cpg_list) {
4c7ee1
 		r = cpg_dispatch(entry->handle, CS_DISPATCH_ALL);
4c7ee1
-		if (r != CS_OK)
4c7ee1
-			LOG_ERROR("cpg_dispatch failed: %s",
4c7ee1
-				  str_ais_error(r));
4c7ee1
+		if (r != CS_OK) {
4c7ee1
+			if ((entry->cpg_state == INVALID) &&
4c7ee1
+			    (entry->state == LEAVING) &&
4c7ee1
+			    (r == CS_ERR_BAD_HANDLE))
4c7ee1
+				/* It's ok if we've left the cluster */
4c7ee1
+				r = CS_OK;
4c7ee1
+			else
4c7ee1
+				LOG_ERROR("cpg_dispatch failed: %s",
4c7ee1
+					  str_ais_error(r));
4c7ee1
+		}
4c7ee1
 
4c7ee1
 		if (entry->free_me) {
4c7ee1
 			free(entry);