-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: Storage
-
Fully Compatible
-
Repl 2018-01-01, Repl 2018-01-15, Repl 2018-01-29
-
0
I apologize for merging the problems of dropCollection and dropDatabase needing timestamps into the same ticket. They're highly related and how one problem is solved likely influences how the other is solved.
In 3.6, dropping a collection does the following:
- Rename the collection to a special name in the same database
- Replicate the collection drop to the oplog with OpTime T. The write that represents the rename to the catalog is assigned this timestamp.
- Asynchronously, a reaper task will be scheduled to physically drop the collection when T is majority committed. This write that represents dropping the collection from the catalog is not timestamped.
In 3.6, dropping a database works as follows:
- Loop through all collections in the database:
- Drop (rename) the collection.
- Replicate this drop command.
- Wait for all collection drops to become majority committed.
- Finish dropping the database which includes calling StorageEngine::dropDatabase
This is where dropDatabase gets fun. After the command thread wakes up after waiting for the collection drops to become majority committed, it actually races the reaper in dropping the collections. The drops in the linked block are also not performed with a timestamp. As documented by the KVStorageEngine, this dropDatabase method is not called from within the same WriteUnitOfWork as the logOp.
- is depended on by
-
SERVER-32284 awaitReplication can hang when the optime to wait for does not match the minSnapshot.
- Closed
-
SERVER-30809 Investigating remaining writes to the [KV]Catalog that must be timestamped.
- Closed
- is related to
-
SERVER-32532 Two-phase dropDatabase may not replicate all collection drops before the database drop.
- Closed
-
SERVER-32893 Relax replicated collection dropping invariant to ignore `system.indexes`
- Closed
-
SERVER-32534 Have UnorderedFastKeyTable iterators error if the table had been modified.
- Closed