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

[Transfrom] prevent concurrent state persistence when indexer gets triggered during shutdown #69551

Merged
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,22 @@ public synchronized boolean maybeTriggerAsyncJob(long now) {
return false;
}

/*
* ignore if indexer thread is shutting down (after finishing a checkpoint)
* shutting down means:
* - indexer has finished a checkpoint and called onFinish
* - indexer state has changed from indexing to started
* - state persistence has been called but has _not_ returned yet
*
* If we trigger the indexer in this situation the 2nd indexer thread might
* try to save state at the same time, causing a version conflict
* see gh#67121
*/
if (indexerThreadShuttingDown) {
logger.debug("[{}] indexer thread is shutting down. Ignoring trigger.", getJobId());
return false;
}

return super.maybeTriggerAsyncJob(now);
}

Expand Down