Slave plugin needs a way to skip over events from the master

Bug #726729 reported by David Shrewsbury
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Drizzle
Confirmed
Wishlist
Unassigned
7.0
Won't Fix
Wishlist
Unassigned

Bug Description

In order to recover from errors on the slave, we need a way to start the slave with an option to skip over the next N events received from the master. Basically implementing the equivalent of MySQL's --sql_slave_skip_counter option.

Changed in drizzle:
milestone: none → 2011-03-14
importance: Undecided → Medium
status: Confirmed → In Progress
Revision history for this message
David Shrewsbury (dshrews) wrote :

Need to think some more about the design of this and how to best handle various scenarios. Right now, this can all be managed manually by just deleting from sys_replication.queue without the slave plugin running.

Some notes for myself about some scenarios:

If --queue-skip-counter=N is given to slave plugin:

[Case 1] last_commit_id is set in applier_state
    In init()
      - Get last_commit_id
         SELECT last_applied_commit_id FROM sys_replication.applier_state
      - Calculate next commit id that is N ahead of last_commit_id
         SELECT MAX(b.commit_order) AS next_commit_id
         FROM (SELECT commit_order
               FROM sys_replication.queue
               WHERE commit_order > :last_applied_commit_id
               ORDER BY commit_order
               LIMIT :N + 1) AS b
      - DELETE FROM sys_replication.queue
        WHERE commit_order < :next_commit_id

[Case 2] No last_applied_commit_id in applier_state
    In init()
      - Get up to N commit_order from queue ordered from low to high
      - Delete these from queue

Questions:
   How should we handle the case where we are told to skip N but
   there are less than N entries in the queue? Skip as much as we
   can, or not skip at all?

Revision history for this message
David Shrewsbury (dshrews) wrote :

Moving this to wishlist for now since this isn't strictly necessary, only a convenience option.

Changed in drizzle:
assignee: David Shrewsbury (dshrews) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.