vitalif / vitastor

Simplified distributed block and file storage with strong consistency, like in Ceph (repository mirror)
https://vitastor.io
Other
128 stars 22 forks source link

journal check_available error #38

Closed mirrorll closed 2 years ago

mirrorll commented 2 years ago

if journal used_start close to journal len and then with small write will cause journal check_available error (no_same_sector_overwrites == true). for example: journal.len : 0x1000000, used_start : 0xffa000, next_free: 0xff8000. for write 4k data to journal, because (next_free + journal.entry + data + JOURNAL_STABILIZE_RESERVATION ) is over journal len , then next_pos = next_pos + data_after. it not satisfy next_pos >= bs->journal.used_start-bs->journal.block_size, so data allow to write to journal, it is incorrect.

vitalif commented 2 years ago

Hi, it seems you're right, thanks :-)