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.
Loading
Please register or sign in to comment