[SERVER-30081] Add a WiredTigerKVEngine "recovery" method that reconciles the _mdb_catalog and WT tables. Created: 10/Jul/17  Updated: 30/Oct/23  Resolved: 15/Aug/17

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 3.5.12

Type: Task Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Daniel Gottlieb (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-29213 Have KVWiredTigerEngine implement Sto... Closed
Backwards Compatibility: Fully Compatible
Sprint: Storage 2017-08-21
Participants:

 Comments   
Comment by Githook User [ 15/Aug/17 ]

Author:

{'username': 'dgottlieb', 'email': 'daniel.gottlieb@mongodb.com', 'name': 'Daniel Gottlieb'}

Message: SERVER-30081: Run storage recovery at startup.
Branch: master
https://github.com/mongodb/mongo/commit/3138119968a4d5bb7602bc766762d571ae5cd248

Comment by Daniel Gottlieb (Inactive) [ 25/Jul/17 ]

WT table creation/deletion are not part of transactions. After the `_mdb_catalog` is rolled back (via replication rollback or a node starting up from a "stable" checkpoint), some state may need to be reconciled. The cases to consider:

Case 1: The _mdb_catalog references a collection ident that WiredTiger does not know of. This would imply a collection drop was rolled back. This is an illegal case and should result in a crash.
Case 2: The _mdb_catalog references an index ident that WiredTiger does not know of. This implies an index drop was rolled back. This method will recreate the index from the bson index specification found in the _mdb_catalog.
Case 3: WiredTiger has an ident (`collection-` or `index-`) that is not referenced in the `_mdb_catalog`. This implies a collection/index creation was rolled back. The WT table will be dropped.

Because this method will be run at `mongod` startup, possibly during StorageEngine initialization, it may not be legal to use methods that have side-effects on the in-memory catalog.

Generated at Thu Feb 08 04:22:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.