Skip to content

Commit

Permalink
Fix FoundationDB#1898: Indexing: periodic "Built Range" log message i…
Browse files Browse the repository at this point in the history
…s broken
  • Loading branch information
jjezra committed Nov 7, 2022
1 parent c4a348b commit adb96a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Expand Up @@ -15,7 +15,7 @@ The Guava dependency version has been updated to 31.1. Projects may need to chec
// begin next release
### NEXT_RELEASE
* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Indexing: periodic "Built Range" log message is broken [(Issue #1898)](https://github.com/FoundationDB/fdb-record-layer/issues/1898)
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
Expand Down
Expand Up @@ -139,6 +139,7 @@ public enum LogMessageKeys {
WROTE_INDEX,
NEW_STORE,
RECORDS_WHILE_BUILDING,
RECORDS_PER_SECOND,
DOCUMENT,
SESSION_ID,
INDEXER_SESSION_ID,
Expand Down
Expand Up @@ -590,11 +590,13 @@ protected CompletableFuture<Boolean> throttleDelayAndMaybeLogProgress(SubspacePr
int toWait = (recordsPerSecond == IndexingCommon.UNLIMITED) ? 0 : 1000 * limit / recordsPerSecond;

if (LOGGER.isInfoEnabled() && shouldLogBuildProgress()) {
LOGGER.info(KeyValueLogMessage.build("Built Range",
LOGGER.info(KeyValueLogMessage.build("Indexer: Built Range",
subspaceProvider.logKey(), subspaceProvider,
LogMessageKeys.LIMIT, limit,
LogMessageKeys.DELAY, toWait)
LogMessageKeys.DELAY, toWait,
LogMessageKeys.RECORDS_PER_SECOND, recordsPerSecond)
.addKeysAndValues(additionalLogMessageKeyValues)
.addKeysAndValues(indexingLogMessageKeyValues())
.addKeysAndValues(common.indexLogMessageKeyValues())
.toString());
}
Expand Down Expand Up @@ -622,7 +624,7 @@ private void validateTimeLimit(int toWait) {
private boolean shouldLogBuildProgress() {
long interval = common.config.getProgressLogIntervalMillis();
long now = System.currentTimeMillis();
if (interval == 0 || interval < (now - timeOfLastProgressLogMillis)) {
if (interval == 0 || interval > (now - timeOfLastProgressLogMillis)) {
return false;
}
timeOfLastProgressLogMillis = now;
Expand Down Expand Up @@ -811,7 +813,7 @@ protected CompletableFuture<Void> iterateAllRanges(List<Object> additionalLogMes
// all done
return AsyncUtil.READY_FALSE;
}
return throttleDelayAndMaybeLogProgress(subspaceProvider, Collections.emptyList());
return throttleDelayAndMaybeLogProgress(subspaceProvider, additionalLogMessageKeyValues);
}
final RuntimeException unwrappedEx = getRunner().getDatabase().mapAsyncToSyncException(ex);
if (LOGGER.isInfoEnabled()) {
Expand Down

0 comments on commit adb96a0

Please sign in to comment.