bolt icon indicating copy to clipboard operation
bolt copied to clipboard

Meta2 make DBFile invalid

Open qw4990 opened this issue 6 years ago • 1 comments

Write-Transactions update Meta1 on commit, and Meta2 only be updated at Backup (invoke tx.WriteTo);

So, please consider this case:

  1. Assume my DB's freelist is stored in Page34, and I backup it now; Then the page id of freelist in meta2 is 34 now;
  2. Then I do some write-transactions on the new DB file, obviously the Page34 maybe reallocated as a branch page or a leaf page;
  3. If meta1 is written to broken now, then meta2 is used, and the Page34 is regard as a freelist page again;

qw4990 avatar Feb 14 '18 10:02 qw4990

@qw4990 do you have some example code that triggers the breakage?

heyitsanthony avatar Feb 14 '18 19:02 heyitsanthony