-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 4.0.4
-
Component/s: Replication
-
None
-
Fully Compatible
-
v4.2, v4.0
-
Repl 2019-06-03, Repl 2019-06-17, Repl 2019-07-01, Repl 2019-07-15
-
47
This ticket banned dropping the oplog in standalone mode entirely on storage engines that support the replSetResizeOplog command.
Original Description
Currently the oplog cannot be dropped while running in replset mode, but can be dropped as standalone. Until recently the procedure to resize the oplog included dropping the oplog while in standalone, however, doing this procedure on an uncleanly shutdown 4.0 mongod causes committed writes to be lost (because they only existed in the oplog, and the resize preserves only the final oplog entry, see DOCS-12230 and SERVER-38174 for more details). It would be much better if attempting this procedure in 4.0 did not result in oplog entries being lost, eg. if dropping the oplog failed.
Completely forbidding oplog drop (even when standalone) would interfere with the use case of restoring a filesystem snapshot as a test standalone. A better alternative would be to forbid dropping the oplog only if local.system.replset contains documents. This way, users who are sure they want to drop the oplog can do so by first removing the documents from local.system.replset (which can't be dropped, but can have its contents removed) and then restarting the standalone. Whereas users who are just trying to perform a manual oplog resize will be stopped before any data loss.
If we choose not to do this, then at the very least we should improve the "standalone-but-replset-config-exists" startup warning to specifically warn against to manually resizing the oplog.
- is related to
-
SERVER-41792 Starting replica set member standalone with recoverFromOplogAsStandalone as true should replay entries from oplog based on the checkpoint we start from.
- Closed
-
TOOLS-2332 oplog_replay_local_rs.js fails on server latest
- Closed
-
SERVER-41818 Add a new method in storage API for fetching updateCappedSize support
- Closed
-
SERVER-47558 Revert SERVER-38356 on 4.0
- Closed
-
SERVER-47567 Prevent incorrectly dropping oplog on 4.0
- Closed
- related to
-
SERVER-38174 Starting replica set member standalone can lose committed writes starting in MongoDB 4.0
- Closed
-
SERVER-42129 Modify test to account for the ephemeralForTest storage engine's missing oplog after restart
- Closed
-
SERVER-42131 Modify test to account for storage engines that do not support the replSetResizeOplog command
- Closed
-
SERVER-44440 Consider disallowing users from writing to special local database collections
- Backlog