-
Notifications
You must be signed in to change notification settings - Fork 649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
memory leak because the database is corrupted #872
Comments
Thanks for reporting the issue. The db file is somehow corrupted. The steps to fix the corrupted db file:
The final The root cause isn't super clear yet. It might be due to mistakenly reusing a non-free page. We will try refactor the freelist management and improve the test coverage in next major release. Refer to #789 |
I feel that your response helped me successfully fix the metadata.db. I will continue to monitor the root cause moving forward. |
We have several surgery commands, we may need to use different command for different case. Unfortunately, it needs some expertise on bbolt to figure out how to fix the corrupted db file. bbolt/cmd/bbolt/command_surgery.go Lines 26 to 31 in 92c7414
Also not every corrupted db file is guaranteed to be fixed by the surgery commands, just like a doctor cannot guarantee to cure every patient. |
The issue occurs when Docker accesses the metadata.db database. The manifestation of the database corruption is the creation of an invalid
pageNode
,bbolt/cursor.go
Lines 172 to 185 in 92c7414
where the flags are 16 instead of the
leafPage
value of 0x02, resulting in continuous creation of invalidpageNodes
.I provided a detailed explanation in Moby:
moby/moby#49074
I tried to add a new leafPage to c.stack. First, I checked p.flags. If the value is 16, which is an invalid value, I do not add it and simply break out of the loop. This way, it directly causes a panic and throws an error up the call stack
The text was updated successfully, but these errors were encountered: