[SERVER-35127] dropDatabase oplog entries can commit collection drops with a timestamp Created: 21/May/18  Updated: 29/Oct/23  Resolved: 23/May/18

Status: Closed
Project: Core Server
Component/s: Replication, Storage
Affects Version/s: None
Fix Version/s: 4.0.0-rc1, 4.1.1

Type: Bug 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:
Backports
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.0
Sprint: Storage NYC 2018-06-04
Participants:
Linked BF Score: 0

 Description   

Collection drops happen in two writes. The first write renames the collection to a "drop pending" namespace. This write must be timestamped with the optime of the collection drop. The second write is to remove the collection from the catalog. This write must happen after the rename has become majority committed. This write that removes from the catalog must not be timestamped[1].

Commands being processed via oplog application use a timestamp block that sets a timestamp at commit time.

[1] KVStorageEngine::dropDatabase has a mechanism to disable this timestamp for non-replicated collections, but not for replicated collections. This was introduced back when it was a goal to appropriately timestamp collection drops. However, table drops are not transactional, which means dropped tables do not come back after a crash, even if the last checkpoint was taken before the table was dropped. If the write that removes a collection from the catalog is timestamped, there's a possibility that this write will not become "stable" when performing clean shutdown. Because the table is already dropped, the data files on disk would be inconsistent; a collection will exist without its backing table.



 Comments   
Comment by Githook User [ 23/May/18 ]

Author:

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

Message: SERVER-35127: Do not timestamp any collection drops committed by dropDatabase.

(cherry picked from commit 7730b27795b642ac772411cfba25f165ddb265e7)
Branch: v4.0
https://github.com/mongodb/mongo/commit/04a684897ae63c60d7e52acf432d03cc341757f6

Comment by Githook User [ 23/May/18 ]

Author:

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

Message: SERVER-35127: Do not timestamp any collection drops committed by dropDatabase.
Branch: master
https://github.com/mongodb/mongo/commit/7730b27795b642ac772411cfba25f165ddb265e7

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