|
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.
|