[Remote Store] Sync segments in refresh listener on refresh after commit #10821
Labels
enhancement
Enhancement or improvement to existing feature or request
Storage:Durability
Issues and PRs related to the durability framework
Storage:Remote
v2.12.0
Issues and PRs related to version 2.12.0
Is your feature request related to a problem? Please describe.
During replica to primary promotion, there is a case where the
runAfterRefreshExactlyOnce
is executed once while the syncSegments is not. The reason for this is that whenever the primary term changes, we are able to detect it by primary term check as below.OpenSearch/server/src/main/java/org/opensearch/index/shard/RemoteStoreRefreshListener.java
Line 165 in 14d4a63
However, the same check would not evaluate to true when the same condition is evaluated in syncSegments. This can lead to a state where the local refresh time and seq no gets updated, but the remote refresh time and seq no dont. It leads to continuous lag. Please note that this condition is mainly concerning the case when didRefresh is false and remote directory is non empty.
Describe the solution you'd like
In should sync method, we also check if this is a refresh after commit.
The text was updated successfully, but these errors were encountered: