Using --recoverFromOplogAsStandalone can result in index builds crashing the server

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 4.4.14, 6.0.0-rc0, 5.0.7
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.0, v4.4
    • Hide

      See Matt's patch build.

      Show
      See Matt's patch build .
    • Execution Team 2022-03-21
    • 146
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      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}
      

       

            Assignee:
            Gregory Wlodarek
            Reporter:
            Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: