[SERVER-35671] DatabaseHolderImpl::closeAll can leave catalog in an incomplete state Created: 19/Jun/18 Updated: 29/Oct/23 Resolved: 05/Jul/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Storage |
| Affects Version/s: | None |
| Fix Version/s: | 4.0.1, 4.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Gottlieb (Inactive) | Assignee: | Ben Judd |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||
| Operating System: | ALL | ||||||||||||||
| Backport Requested: |
v4.0
|
||||||||||||||
| Steps To Reproduce: | Running a replica set with --setParameter enableTestCommands=true: Shell 1:
Shell 2:
|
||||||||||||||
| Sprint: | Storage NYC 2018-07-02, Storage NYC 2018-07-16 | ||||||||||||||
| Participants: | |||||||||||||||
| Linked BF Score: | 60 | ||||||||||||||
| Description |
|
As `closeAll` iterates and closes each individual database, it checks that the database has no background operations. If that check fails, a uassert is thrown. That uassert reaching the user implies the database is left in a state that is partially closed. In particular the databases returned by `StorageEngine::listDatabases` may not exist in a call to `DatabaseHolder::get`. Suggested fix: Move the `BackgroundOperation::assertNoBgOpInProgForDb` call to the previous scan that grabs the database names to close. I.e: assert the complete precondition before taking any actions. |
| Comments |
| Comment by Githook User [ 19/Jul/18 ] |
|
Author: {'name': 'Ben Judd', 'email': 'ben.judd@10gen.com', 'username': 'Icantjuddle'}Message: (cherry picked from commit c0fecea1c3eb40fe6b5affe7cd505b5ce7dc2faa) |
| Comment by Githook User [ 05/Jul/18 ] |
|
Author: {'username': 'Icantjuddle', 'name': 'Ben Judd', 'email': 'ben.judd@10gen.com'}Message: |