mirror of
https://github.com/google/nomulus.git
synced 2025-07-22 18:55:58 +02:00
Add more logging to replay commit logs action (#1232)
This commit is contained in:
parent
4e30d020ca
commit
3f9fec98d5
1 changed files with 3 additions and 0 deletions
|
@ -107,6 +107,7 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
logger.atInfo().log("Beginning replay of commit logs.");
|
||||||
replayFiles();
|
replayFiles();
|
||||||
response.setStatus(HttpServletResponse.SC_OK);
|
response.setStatus(HttpServletResponse.SC_OK);
|
||||||
String message = "ReplayCommitLogsToSqlAction completed successfully.";
|
String message = "ReplayCommitLogsToSqlAction completed successfully.";
|
||||||
|
@ -126,10 +127,12 @@ public class ReplayCommitLogsToSqlAction implements Runnable {
|
||||||
DateTime replayTimeoutTime = clock.nowUtc().plus(REPLAY_TIMEOUT_DURATION);
|
DateTime replayTimeoutTime = clock.nowUtc().plus(REPLAY_TIMEOUT_DURATION);
|
||||||
// Start at the first millisecond we haven't seen yet
|
// Start at the first millisecond we haven't seen yet
|
||||||
DateTime fromTime = jpaTm().transact(() -> SqlReplayCheckpoint.get().plusMillis(1));
|
DateTime fromTime = jpaTm().transact(() -> SqlReplayCheckpoint.get().plusMillis(1));
|
||||||
|
logger.atInfo().log("Starting replay from: %s.", fromTime);
|
||||||
// If there's an inconsistent file set, this will throw IllegalStateException and the job
|
// If there's an inconsistent file set, this will throw IllegalStateException and the job
|
||||||
// will try later -- this is likely because an export hasn't finished yet.
|
// will try later -- this is likely because an export hasn't finished yet.
|
||||||
ImmutableList<GcsFileMetadata> commitLogFiles =
|
ImmutableList<GcsFileMetadata> commitLogFiles =
|
||||||
diffLister.listDiffFiles(fromTime, /* current time */ null);
|
diffLister.listDiffFiles(fromTime, /* current time */ null);
|
||||||
|
logger.atInfo().log("Found %d new commit log files to process.", commitLogFiles.size());
|
||||||
int processedFiles = 0;
|
int processedFiles = 0;
|
||||||
for (GcsFileMetadata metadata : commitLogFiles) {
|
for (GcsFileMetadata metadata : commitLogFiles) {
|
||||||
// One transaction per GCS file
|
// One transaction per GCS file
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue