SOLR-16561: Use autoSoftCommmitMaxTime as preferred poll interval of … #1189
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
TLOG/PULL replicas use IndexFetcher to fetch segment files from leaders. Once new segment files are downloaded and merged into existing index, a new Searcher is opened so the updated data is made available to the clients. The poll interval is determined by following code in ReplicateFromLeader
In a typical config for replication using TLOG/PULL replicas where data visibility is less important (a trade-off to avoid NRT replicas), we set a short commit time to persist changes and long soft-commit time to make changes visible.
With about config, the poll interval will be 15/2 = 7 sec. This leads to frequent opening of new Searchers which causes huge impact on realtime user queries, especially if the new Searcher takes long time to warmup. This also makes changes visible on followers ahead of leaders.
Because the polling of new segment files is more about visibility because TLOG replicas still get updates to tlog files via UpdateHandler (this is my understanding). It seems more appropriate to use autoSoftCommmitMaxTime as the poll interval.
Solution
I would proposed change below where autoSoftCommmitMaxTime is chosen as the preferred interval. This will make the poll interval much longer and make the visibility order more inline with eventual consistency pattern.
Tests
The difference can only be tested with proper replication config and controlled indexing and user queries. The change has been tried in my environment and showed much less impact on realtime queries compared with previous tests.
Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.