Skip to content

[client] Ensure UPDATE_BEFORE and UPDATE_AFTER are never split across poll batches#3149

Open
loserwang1024 wants to merge 1 commit intoapache:mainfrom
loserwang1024:fix-binlog
Open

[client] Ensure UPDATE_BEFORE and UPDATE_AFTER are never split across poll batches#3149
loserwang1024 wants to merge 1 commit intoapache:mainfrom
loserwang1024:fix-binlog

Conversation

@loserwang1024
Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #2880

Brief change log

When CompletedFetch.fetchRecords() hits maxRecords, it may cut between a -U (UPDATE_BEFORE) and +U (UPDATE_AFTER) pair. If the next poll returns records from multiple buckets, downstream stateful converters (e.g., BinlogRowConverter) can see an orphaned -U whose pendingUpdateBefore state gets corrupted by interleaved records from other buckets.

Fix: after the fetch loop, if the last record is UPDATE_BEFORE, fetch one additional record to include the matching UPDATE_AFTER in the same batch. Extract the per-record fetch logic into a reusable fetchRecord() method.

Tests

API and Format

Documentation

… poll batches

When CompletedFetch.fetchRecords() hits maxRecords, it may cut between a -U
(UPDATE_BEFORE) and +U (UPDATE_AFTER) pair. If the next poll returns records
from multiple buckets, downstream stateful converters (e.g., BinlogRowConverter)
can see an orphaned -U whose pendingUpdateBefore state gets corrupted by
interleaved records from other buckets.

Fix: after the fetch loop, if the last record is UPDATE_BEFORE, fetch one
additional record to include the matching UPDATE_AFTER in the same batch.
Extract the per-record fetch logic into a reusable fetchRecord() method.
@loserwang1024
Copy link
Copy Markdown
Contributor Author

@luoyuxia @wuchong , CC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant