Slave plugin needs a way to skip over events from the master
Bug #726729 reported by
David Shrewsbury
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_
Changed in drizzle: | |
milestone: | none → 2011-03-14 |
importance: | Undecided → Medium |
status: | Confirmed → In Progress |
Changed in drizzle: | |
assignee: | David Shrewsbury (dshrews) → nobody |
To post a comment you must log in.
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 commit_ id FROM sys_replication .applier_ state .queue
WHERE commit_order > :last_applied_ commit_ id
ORDER BY commit_order
LIMIT :N + 1) AS b .queue
In init()
- Get last_commit_id
SELECT last_applied_
- 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
- DELETE FROM sys_replication
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?