-
Notifications
You must be signed in to change notification settings - Fork 25.6k
CCR: Fix incorrect read request completion condition #32266
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
CCR: Fix incorrect read request completion condition #32266
Conversation
Today we consider a read request is exhausted if from_seqno is equal to or greater than the max_seqno. However, if we stop when from_seqno equals to the max_required_seqno, we will miss an operation whose seqno is max_required_seqno because that operation was not fetched yet. Our CI https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+ccr+feature-branch-periodic/997/console found that we missed an operation.
|
Pinging @elastic/es-distributed |
|
We missed an operation in this run |
bleskes
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Good catch
| task.coordinateReads(); | ||
| ShardChangesAction.Response response = generateShardChangesResponse(0, 64, 1L, 64L); | ||
| task.handleReadResponse(0L, 64L, response); | ||
| ShardChangesAction.Response response = generateShardChangesResponse(0, 64, 1L, 63L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if using fromSeq and toSeqNo (instead of size) will result in this being less confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
|
Thanks @bleskes for reviewing. |
Today we consider a read request is exhausted if from_seqno is equal to or greater than the max_required_seqno. However, if we stop when from_seqno equals to the max_required_seqno, we will miss an operation whose seqno is max_required_seqno because we have not seen that operation yet.
Today we consider a read request is exhausted if
from_seqnois equal to or greater than themax_required_seqno. However, if we stop whenfrom_seqnoequals to themax_required_seqno, we will miss an operation whose seqno ismax_required_seqnobecause that operation was not seen yet.