herddb
herddb copied to clipboard
Irrecoverable truncate on BRIN
BUG REPORT
- Please describe the issue you observed: When applying a truncate on BRIN indexes every data is immediately deleted. If the tablespace is restarted before the next checkpoint the index remains in a bogus state (no data but loaded from a checkpoint where data should exists)
-
What did you do?
-
What did you expect to see? No data drop before checkpoint
-
What did you see instead? Data drop before checkpoint
After further analysis we can keep this bug alive for now: no data should be served before the full recovery and during full recovery the BRIN will be truncated again.
Fixing it whould need to no overwerite old pages avoiding to reset currentBlockId
to 0 in reset()
method. Unfortunately the brin head block actually MUST be at id 0 so at least one overwrite whould happen.