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

Fixes #2936: Missing subspace provider in FDBRecordStore logs #2937

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion docs/ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Starting with version [3.4.455.0](#344550), the semantics of `UnnestedRecordType
// begin next release
### NEXT_RELEASE

* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
* **Bug fix** Missing subspace provider information added to `FDBRecordStore` logs [(Issue #2936)](https://github.com/FoundationDB/fdb-record-layer/issues/2936)
* **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
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,8 @@ private boolean canDeleteWhereOnConstituent(final @Nonnull IndexMaintainer index
private CompletableFuture<Void> run() {
if (evaluated == null) {
// no record types
LOGGER.warn("Tried to delete prefix with no record types");
LOGGER.warn(KeyValueLogMessage.of("Tried to delete prefix with no record types",
subspaceProvider.logKey(), subspaceProvider.toString(context)));
return AsyncUtil.DONE;
}

Expand Down Expand Up @@ -3168,7 +3169,8 @@ private void updateIndexState(@Nonnull String indexName, byte[] indexKey, @Nonnu
if (LOGGER.isInfoEnabled()) {
LOGGER.info(KeyValueLogMessage.of("index state change",
LogMessageKeys.INDEX_NAME, indexName,
LogMessageKeys.TARGET_INDEX_STATE, indexState.name()
LogMessageKeys.TARGET_INDEX_STATE, indexState.name(),
subspaceProvider.logKey(), subspaceProvider.toString(context)
));
}
if (recordStoreStateRef.get() == null) {
Expand Down Expand Up @@ -3507,6 +3509,7 @@ private void logExceptionAsWarn(KeyValueLogMessage message, Throwable exception)
message.addKeysAndValues(((LoggableException)ex).getLogInfo());
}
}
message.addKeyAndValue(subspaceProvider.logKey(), subspaceProvider.toString(context));
LOGGER.warn(message.toString(), exception);
}
}
Expand Down Expand Up @@ -4226,7 +4229,6 @@ public CompletableFuture<Void> rebuildIndex(@Nonnull final Index index, @Nonnull
LogMessageKeys.INDEX_NAME, index.getName(),
LogMessageKeys.INDEX_VERSION, index.getLastModifiedVersion(),
LogMessageKeys.REASON, reason.name(),
subspaceProvider.logKey(), subspaceProvider.toString(context),
LogMessageKeys.SUBSPACE_KEY, index.getSubspaceKey()), t);
}
// Only call method that builds in the current transaction, so never any pending work,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,14 @@ default RecordCursor<FDBIndexedRecord<M>> scanIndexRecords(@Nonnull final Index
} catch (UnsupportedRemoteFetchIndexException ex) {
// In this case (e.g. the index maintainer does not support remote fetch), log as info
if (LOGGER.isInfoEnabled()) {
LOGGER.info(KeyValueLogMessage.of("scanIndexRecords: Remote fetch unsupported, continuing with Index scan",
KeyValueLogMessage msg = KeyValueLogMessage.build("scanIndexRecords: Remote fetch unsupported, continuing with Index scan",
LogMessageKeys.MESSAGE, ex.getMessage(),
LogMessageKeys.INDEX_NAME, index.getName()));
LogMessageKeys.INDEX_NAME, index.getName());
final SubspaceProvider subspaceProvider = getSubspaceProvider();
if (subspaceProvider != null) {
msg.addKeyAndValue(subspaceProvider.logKey(), subspaceProvider.toString(getContext()));
}
LOGGER.info(msg.toString());
}
return scanIndexRecords(index, scanRange.getScanType(), scanRange.getScanRange(), continuation, orphanBehavior, scanProperties);
} catch (Exception ex) {
Expand Down