Suppress cluster UUID logs in 6.8/7.x upgrade (#56835)

Today a 7.x node logs `cluster UUID set to [...]` on every cluster state update
received from a 6.8 master, because 6.8 nodes are not able to commit the
cluster UUID properly. We could try and deduplicate these logs somehow, but
that would introduce a good deal of complexity. Instead, this commit suppresses
these logs entirely when receiving cluster state updates from a 6.8 master.
This commit is contained in:
David Turner 2020-05-15 19:45:32 +01:00 committed by GitHub
parent 54d3cc74ec
commit a3e845cbad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -505,7 +505,12 @@ public class CoordinationState {
metadataBuilder = Metadata.builder(lastAcceptedState.metadata());
}
metadataBuilder.clusterUUIDCommitted(true);
logger.info("cluster UUID set to [{}]", lastAcceptedState.metadata().clusterUUID());
if (lastAcceptedState.term() != ZEN1_BWC_TERM) {
// Zen1 masters never publish a committed cluster UUID so if we logged this it'd happen on on every update. Let's just
// not log it at all in a 6.8/7.x rolling upgrade.
logger.info("cluster UUID set to [{}]", lastAcceptedState.metadata().clusterUUID());
}
}
if (metadataBuilder != null) {
setLastAcceptedState(ClusterState.builder(lastAcceptedState).metadata(metadataBuilder).build());