Skip to content
This repository has been archived by the owner on Mar 9, 2019. It is now read-only.

Meta2 make DBFile invalid #744

Open
qw4990 opened this issue Feb 14, 2018 · 1 comment
Open

Meta2 make DBFile invalid #744

qw4990 opened this issue Feb 14, 2018 · 1 comment

Comments

@qw4990
Copy link

qw4990 commented Feb 14, 2018

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;
@heyitsanthony
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants