Skip to content

Conversation

@jjezra
Copy link
Contributor

@jjezra jjezra commented Nov 6, 2025

Catching an exception, the IndexingMerger attempts to detect if it should lessen work and retry. Currently it is an include list of known "retyable" errors. If the error is not detected correctly, or not predicted, it will not retry.
Being a background process, however, it is better and safer to retry by default.

Resolves #3731

 Catching an exception, the IndexingMerger attempts to detect if it should lessen work and retry. Currently it is an include list of known "retyable"
 errors. If the error is not detected correctly, or not predicted, it will not retry.
 Being a background process, however, it is better and safer to retry by default.

  Resolves FoundationDB#3731
@jjezra jjezra added the enhancement New feature or request label Nov 6, 2025
if (ex == null) {
return false;
}
final Set<Integer> lessenWorkCodes = new HashSet<>(Arrays.asList(
Copy link
Contributor

Choose a reason for hiding this comment

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

This set can be declared as a static instance - no need to instantiate every time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just wonder - wouldn't the JVM do the right thing here? It seems like an obvious optimization and I know that other languages are performing this optimization (and much more).

@jjezra jjezra requested a review from ohadzeliger November 7, 2025 21:03
// Expecting AsyncToSyncTimeoutException or an instance of TimeoutException. However, cannot
// refer to AsyncToSyncTimeoutException without creating a lucene dependency
// TODO: remove this kludge
if (e.getClass().getCanonicalName().contains("Timeout") ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

From the PR description:

Being a background process, however, it is better and safer to retry by default.

Why not just have this return false if there is any exception, except InterruptedException.
Here you abort for any exception that doesn't have Timeout in its name, or an FDBException as its cause.

Either way, it seems like having a test with a mock IndexMaintainer that has various failure scenarios would be valuable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IndexingMerger: lessen work and retry by default

3 participants