Improve logging/comments for commit log forks (#1464)

* Improve logging/comments for commit log forks

It looks like the diff file lister is doing a second constructDiffSequence()
when a commit diff file is missing from the final sequence for purely
informational purposes.  However, this purpose wasn't clear when investigating
an actual case of this.

This PR adds another warning to hopefully make the log output a bit more
useful, and also promotes the "gap" log message to a warning and adds a
comment indicating the purpose of the second constructDiffSequence().
This commit is contained in:
Michael Muller 2021-12-13 13:15:41 -05:00 committed by GitHub
parent efd2f4ea30
commit 01a5eadace
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -91,7 +91,7 @@ class GcsDiffFileLister {
// If we hit a gap, quit. // If we hit a gap, quit.
if (blobInfo == null) { if (blobInfo == null) {
logger.atInfo().log( logger.atWarning().log(
"Gap discovered in sequence terminating at %s, missing file: %s", "Gap discovered in sequence terminating at %s, missing file: %s",
sequence.lastKey(), filename); sequence.lastKey(), filename);
logger.atInfo().log("Found sequence from %s to %s.", checkpointTime, lastTime); logger.atInfo().log("Found sequence from %s to %s.", checkpointTime, lastTime);
@ -167,6 +167,10 @@ class GcsDiffFileLister {
break; break;
} }
if (!sequence.containsKey(key)) { if (!sequence.containsKey(key)) {
// Recalculate the sequence for purely informational purposes.
logger.atWarning().log(
"Fork found in commit log history. The following sequence "
+ "is disconnected from the sequence of the final commit:");
constructDiffSequence(gcsBucket, upperBoundTimesToBlobInfo, fromTime, key, sequence); constructDiffSequence(gcsBucket, upperBoundTimesToBlobInfo, fromTime, key, sequence);
checkForMoreExtraDiffs = true; checkForMoreExtraDiffs = true;
inconsistentFileSet = true; inconsistentFileSet = true;