Skip to content
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

Resuming can caused missed replication events #351

Closed
SpencerMalone opened this issue Jun 11, 2024 · 1 comment
Closed

Resuming can caused missed replication events #351

SpencerMalone opened this issue Jun 11, 2024 · 1 comment

Comments

@SpencerMalone
Copy link

I've seen a few cases of missed rows that I believe can be tied to resuming, but please correct me if I'm wrong:

The binlog processing algorithm looks something like this with state tracking:

  1. Streamer is a mysql replication client that retrieves events
  2. Pass off events by default to defaultEventHandler
  3. defaultEventHandler calls handleRowsEvent
  4. handleRowsEvent filters + creates batches of events
  5. handleRowsEvent hands off to event listeners (zoom into this later on)
  6. Record binlog pos in state

So the default event listener is BinlogWriter.BufferBinlogEvents, which pushes events onto a channel, while a separate thread pulls off the channel and processes it.

Here's the problem: step 5 for an applicable event is only blocked by pushing onto the channel. Actual event processing happens in another non-blocking thread from that one (unless it backs up so much the channel gets full), but in practice this means it is somewhat common that when write load is high, and a ferry run is interrupted, the data in the event channel is lost.

@riccardo-casazza riccardo-casazza added Bug Something isn't working SEV-3 labels Jun 11, 2024
@riccardo-casazza
Copy link

riccardo-casazza commented Jun 11, 2024

@SpencerMalone, if you configure a verifier, the move will fail and you will be notified.

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

No branches or pull requests

3 participants