Find new memory pages when node drops disk #833
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the system is powered off and reset, containerd experiences a panic:
panic: freepages: failed to get all reachable pages (key[0]=(hex)** on leaf page(1229) needs to be < than key of the next element in ancestor(hex)**. Pages stack: [1974,1229])
Every time a commit is made, the essence is that all nodes on the paths involved in the operation (from tree roots to tree leaves) will drop to the disk. If a new memory page is always found when dropping to the disk, and a conflict occurs due to power failure, the tree roots in the two metas must be healthy because the commit drops to the new memory page.
The node involved in the commit operation collects the original pgid and calls tx.db.freelist after the commit Free。
This always allows for the recovery of database files (./bbolt surgery revise meta page) through meta pages.