Skip to content

Commit

Permalink
Improved logging around remote cluster state (#10892) (#10943)
Browse files Browse the repository at this point in the history
* Improved logging around remote cluster state

(cherry picked from commit d1c94b5)

Signed-off-by: Dhwanil Patel <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 919aef6 commit dcf6974
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -244,9 +244,8 @@ public ClusterMetadataManifest writeFullMetadata(ClusterState clusterState, Stri
allUploadedIndexMetadata.size()
);
} else {
// todo change to debug
logger.info(
"writing cluster state took [{}ms]; " + "wrote full state with [{}] indices",
"writing cluster state took [{}ms]; " + "wrote full state with [{}] indices and global metadata",
durationMillis,
allUploadedIndexMetadata.size()
);
@@ -285,6 +284,7 @@ public ClusterMetadataManifest writeIncrementalMetadata(
if (updateGlobalMetadata || previousManifest.getGlobalMetadataFileName() == null) {
globalMetadataFile = writeGlobalMetadata(clusterState);
} else {
logger.debug("Global metadata has not updated in cluster state, skipping upload of it");
globalMetadataFile = previousManifest.getGlobalMetadataFileName();
}

@@ -305,7 +305,7 @@ public ClusterMetadataManifest writeIncrementalMetadata(
for (final IndexMetadata indexMetadata : clusterState.metadata().indices().values()) {
final Long previousVersion = previousStateIndexMetadataVersionByName.get(indexMetadata.getIndex().getName());
if (previousVersion == null || indexMetadata.getVersion() != previousVersion) {
logger.trace(
logger.debug(
"updating metadata for [{}], changing version from [{}] to [{}]",
indexMetadata.getIndex(),
previousVersion,
@@ -342,18 +342,22 @@ public ClusterMetadataManifest writeIncrementalMetadata(
if (durationMillis >= slowWriteLoggingThreshold.getMillis()) {
logger.warn(
"writing cluster state took [{}ms] which is above the warn threshold of [{}]; "
+ "wrote metadata for [{}] indices and skipped [{}] unchanged indices",
+ "wrote metadata for [{}] indices and skipped [{}] unchanged indices, global metadata updated : [{}]",
durationMillis,
slowWriteLoggingThreshold,
numIndicesUpdated,
numIndicesUnchanged
numIndicesUnchanged,
updateGlobalMetadata
);
} else {
logger.trace(
"writing cluster state took [{}ms]; " + "wrote metadata for [{}] indices and skipped [{}] unchanged indices",
logger.info(
"writing cluster state for version [{}] took [{}ms]; "
+ "wrote metadata for [{}] indices and skipped [{}] unchanged indices, global metadata updated : [{}]",
manifest.getStateVersion(),
durationMillis,
numIndicesUpdated,
numIndicesUnchanged
numIndicesUnchanged,
updateGlobalMetadata
);
}
return manifest;
@@ -605,6 +609,11 @@ private void writeMetadataManifest(String clusterName, String clusterUUID, Clust
blobStoreRepository.getCompressor(),
FORMAT_PARAMS
);
logger.debug(
"Metadata manifest file [{}] written during [{}] phase. ",
fileName,
uploadManifest.isCommitted() ? "commit" : "publish"
);
}

private String fetchPreviousClusterUUID(String clusterName, String clusterUUID) {
@@ -912,6 +921,7 @@ private List<String> createClusterChain(final Map<String, ClusterMetadataManifes
// Getting the previous cluster UUID of a cluster UUID from the clusterUUID Graph
currentUUID = clusterUUIDGraph.get(currentUUID);
}
logger.info("Known UUIDs found in remote store : [{}]", validChain);
return validChain;
}

@@ -1231,7 +1241,7 @@ private void deleteClusterMetadata(
});

if (staleManifestPaths.isEmpty()) {
logger.info("No stale Remote Cluster Metadata files found");
logger.debug("No stale Remote Cluster Metadata files found");
return;
}

Original file line number Diff line number Diff line change
@@ -149,6 +149,7 @@ public RemoteRestoreResult restore(
if (currentState.metadata().clusterUUID().equals(restoreClusterUUID)) {
throw new IllegalArgumentException("clusterUUID to restore from should be different from current cluster UUID");
}
logger.info("Restoring cluster state from remote store from cluster UUID : [{}]", restoreClusterUUID);
remoteMetadata = remoteClusterStateService.getLatestMetadata(currentState.getClusterName().value(), restoreClusterUUID);
remoteMetadata.getIndices().values().forEach(indexMetadata -> {
indexMetadataMap.put(indexMetadata.getIndex().getName(), new Tuple<>(true, indexMetadata));

0 comments on commit dcf6974

Please sign in to comment.