-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Segment Replication] Update RefreshPolicy.WAIT_UNTIL to wait for replica refresh. #6045
Comments
An idea of how to accomplish this:
|
For opensearch 2.7 release with segment replication we are not supporting wait_until requests. Users are not guaranteed that docs will be visible on replica after refresh. So, we only provide read (only on primary) after write consistency for wait_until with segment replication. More details: Wait_until Requests with Segment Replication:
Problem Encountered while trying to support Wait_Until with Segment Replication:*** Problem 1 (Failover Scenario) :** → Consider a scenario where we are having 1 primary shard with 2 replicas in it’s replication group. *** Problem 2 (Relocation Scenario) :** → Consider a scenario where we are having 1 primary shard with 2 replicas in it’s replication group. *** Problem 3 (max Sequence Number):** → Suppose we indexed few docs with wait_until, replica shard will register listeners and wait for segment replication to complete so that it can catch up. Possible Solution to Support Wait_until:→ A possible solution to support wait_until with segment replication is to make use of Streaming Index API to index wait_until requests. Current Situation of Wait_Until with Segment Replication :
|
Current behavior of RefreshPolicy.WAIT_UNTIL waits to ack an index request until the operation is visible/searchable to the client. It does this by registering listeners that complete when the last written translog location after a refresh is at least the furthest translog location from the writes executed in the request. This logic breaks with SR because replicas do not index before writes to the translog, so the last written location is not guaranteed to be visible.
Rather than comparing xlog locations, we should compare the latest max seqNo that the replica has refreshed on. This is made possible with this change, where replicas now receive an accurate seqNo.
The text was updated successfully, but these errors were encountered: