Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improved logging around remote cluster state #10892

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ public ClusterMetadataManifest writeFullMetadata(ClusterState clusterState, Stri
} 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()
);
Expand Down Expand Up @@ -282,6 +282,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");
dhwanilpatel marked this conversation as resolved.
Show resolved Hide resolved
globalMetadataFile = previousManifest.getGlobalMetadataFileName();
}

Expand Down Expand Up @@ -337,18 +338,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;
Expand Down Expand Up @@ -476,6 +481,7 @@ private List<UploadedIndexMetadata> writeIndexMetadataParallel(ClusterState clus
)
);
exceptionList.forEach(exception::addSuppressed);
logger.error("Exception in transferring index metadata to remote store", exception);
dhwanilpatel marked this conversation as resolved.
Show resolved Hide resolved
throw exception;
}
return result;
Expand Down Expand Up @@ -596,6 +602,11 @@ private void writeMetadataManifest(String clusterName, String clusterUUID, Clust
blobStoreRepository.getCompressor(),
FORMAT_PARAMS
);
logger.debug(
"Metadata manifest file [{}] written during [{}] phase. ",
dhwanilpatel marked this conversation as resolved.
Show resolved Hide resolved
fileName,
uploadManifest.isCommitted() ? "commit" : "publish"
);
}

private String fetchPreviousClusterUUID(String clusterName, String clusterUUID) {
Expand Down Expand Up @@ -903,6 +914,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.debug("Known UUIDs found in remote store : [{}]", validChain);
return validChain;
}

Expand Down Expand Up @@ -1217,7 +1229,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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Loading