Skip to content

Conversation

jjezra
Copy link
Contributor

@jjezra jjezra commented Sep 18, 2025

These two parameters, that are used for logging only, can be determined from common at the relevant logging functions.
This resolves #3610.

… functions

   These two parameters, that are used for logging only, can be determined from common at the relevant logging functions.
   This resolves FoundationDB#3610.
@jjezra jjezra added the cleanup Non-breaking/stylistic code cleanup label Sep 18, 2025
@jjezra jjezra marked this pull request as ready for review September 18, 2025 18:12
@jjezra jjezra requested a review from ScottDugas September 18, 2025 18:13
Comment on lines 162 to 165
if (subspaceProvider != null) {
logIf(true, keyValues,
subspaceProvider.logKey(), subspaceProvider);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why use logIf here? It seems like you would either want to do:

Suggested change
if (subspaceProvider != null) {
logIf(true, keyValues,
subspaceProvider.logKey(), subspaceProvider);
}
logIf(subspaceProvider != null, keyValues,
subspaceProvider.logKey(), subspaceProvider);

Or:

Suggested change
if (subspaceProvider != null) {
logIf(true, keyValues,
subspaceProvider.logKey(), subspaceProvider);
}
if (subspaceProvider != null) {
keyValues.add(subspaceProvider.logKey());
keyValues.add(subspaceProvider);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logIf was just for uniformity. The first suggestion may cause a null pointer exception as the subspaceProvider.logKey() part will be evaluated before calling the logIf function. I'll go with the second.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.thenCompose( store -> context.getReadVersionAsync()
.thenCompose(vignore -> {
SubspaceProvider subspaceProvider = common.getRecordStoreBuilder().getSubspaceProvider();
// validation checks, if any, will be performed here
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this comment intended to be that:

buildMultiTargetIndex will do any necessary validation checks

Or, the more problematic for this change:

getSubspaceAsync will do any necessary validation checks

? I'm pretty sure the answer is that buildMultiTargetIndex is doing the validation checks, but wanted to confirm.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment appeared in the indexers as a hint/reminder where to add validations. I think that appears because IndexingByIndex had a source/target indexes validations at the post context.getReadVersionAsync lambda, and then its structure was copied by the other indexers. I did not think that this comment is needed anymore.

@jjezra jjezra requested a review from ScottDugas September 22, 2025 14:07
@ScottDugas ScottDugas merged commit 4d1baac into FoundationDB:main Sep 22, 2025
8 checks passed
@jjezra jjezra deleted the indexing_remove_subspace_param branch September 22, 2025 20:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Non-breaking/stylistic code cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Indexing: remove subspaceProvider and subspace arguments to iterating functions
2 participants