From 01a5eadaceded1a32792ad0c892a37c17a6d6b41 Mon Sep 17 00:00:00 2001 From: Michael Muller Date: Mon, 13 Dec 2021 13:15:41 -0500 Subject: [PATCH] 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(). --- .../main/java/google/registry/backup/GcsDiffFileLister.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/google/registry/backup/GcsDiffFileLister.java b/core/src/main/java/google/registry/backup/GcsDiffFileLister.java index c137d394c..a170f85d1 100644 --- a/core/src/main/java/google/registry/backup/GcsDiffFileLister.java +++ b/core/src/main/java/google/registry/backup/GcsDiffFileLister.java @@ -91,7 +91,7 @@ class GcsDiffFileLister { // If we hit a gap, quit. if (blobInfo == null) { - logger.atInfo().log( + logger.atWarning().log( "Gap discovered in sequence terminating at %s, missing file: %s", sequence.lastKey(), filename); logger.atInfo().log("Found sequence from %s to %s.", checkpointTime, lastTime); @@ -167,6 +167,10 @@ class GcsDiffFileLister { break; } 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); checkForMoreExtraDiffs = true; inconsistentFileSet = true;