Zach Brown e10033b34d scoutfs: migrate dirty btree blocks during wrap
We were seeing ring btree corruption that manifest as the server seeing
stale btree blocks as it tried to read all the btrees to migrate blocks
during a write.  A block it tried to read didn't match its reference.

It turned out that block wasn't being migrated.  It would get stuck
at a position in the ring.  Eventually new block writes would overwrite
it and then the next read would see corruption.

It wasn't being migrated because the block reading function didn't
realize that it had to migrate a dirty block.  The block was written in
a transaction at the end of the ring.   The ring wrapped during
the transaction and then migration tried to migrate the dirty block.
It wouldn't be dirtied, and thus be migrated, because it was already
dirty in the transaction.

The fix is to add more cases to the dirtying decision which takes
migration specifically into account.  We'll no longer short circuit
dirtying blocks for migration when they're in the old half of the ring
even though they're dirty.

Signed-off-by: Zach Brown <zab@versity.com>
2019-05-21 11:41:07 -07:00
Description
No description provided
6.2 MiB
Languages
C 86.4%
Shell 10%
Roff 2.5%
TeX 0.8%
Makefile 0.3%