herddb icon indicating copy to clipboard operation
herddb copied to clipboard

Irrecoverable truncate on BRIN

Open diegosalvi opened this issue 4 years ago • 1 comments

BUG REPORT

  1. 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

diegosalvi avatar Jan 27 '20 11:01 diegosalvi

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.

diegosalvi avatar Jan 27 '20 11:01 diegosalvi