Skip to content
Snippets Groups Projects
Commit 4d56a660 authored by Keith Rarick's avatar Keith Rarick
Browse files

Add a new invariant to reserved space.

A DELETE record can be written at any time, including times when we are
unable to shuffle reserved bytes around. So, to make sure that we don't
lose any reserved bytes, the current binlog must always have reserved
space for some number of complete DELETE records. This lets us fill up
the current binlog exactly with no lost reserved bytes. The only time we
are able to shuffle things around to maintain this property is when
reserving bytes.

We used to try to accomplish this by checking the reserved size of the
current_binlog after each reservation, but that isn't sufficient. The
next binlog can become current and run out of space without any
reservations taking place. This would force us to lose bytes.

Now we check that the current_binlog and *all future binlog* reservation
sizes are suitable to become the current binlog and fill up exactly.

Closes gh-38.
parent 50e0ca22
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment