When starting mongod with --recoverFromOplogAsStandalone, unfinished index builds don't get resumed:
STORAGE 21005 [initandlisten] "Not restarting unfinished index builds because we are in standalone mode"
However, if we come across an oplog entry to start an index build, it will begin building the index.
Once the oplog is replayed, the server enters into a read-only mode:
REPL 21558 [initandlisten] "Setting mongod to readOnly mode as a result of specifying 'recoverFromOplogAsStandalone'"
If the index build was unfinished at this point, it will result in a crash:
STORAGE 20649 [IndexBuildsCoordinatorMongod-0] "Index build: failed","attr":{"buildUUID":{"uuid":{"$uuid":"5be501ba-c27f-4a31-83fa-b865a3e58ca8"}},"collectionUUID":{"uuid":{"$uuid":"8db4911e-8b9e-4904-8496-3b407c876582"}},"namespace":"test.a","error":{"code":20,"codeName":"IllegalOperation","errmsg":"Cannot execute a write operation in read-only mode"}} ASSERT 23081 [IndexBuildsCoordinatorMongod-0] "Invariant failure","attr":{"expr":"status.isA<ErrorCategory::Interruption>() || status.isA<ErrorCategory::ShutdownError>() || status.code() == ErrorCodes::CannotCreateIndex","msg":"Unexpected error code during index build cleanup: IllegalOperation: Cannot execute a write operation in read-only mode","file":"src/mongo/db/index_builds_coordinator.cpp","line":2210}
- is duplicated by
-
SERVER-54968 recoverFromOplogAsStandalone doesn't wait for index builds to finish before switching to read-only mode
- Closed