Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-90008

WiredTigerRecordStore::getLatestOplogTimestamp can throw WriteConflictException unexpectedly

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • ALL
    • Repl 2024-05-13, Repl 2024-05-27, Repl 2024-06-10, Repl 2024-06-24, Repl 2024-07-08, Repl 2024-07-22, Repl 2024-08-05, Execution Team 2024-09-30
    • 0

      This call can throw WriteConflictException. Initially, I thought the invariantWTOK check below would invariant if the return code is WT_ROLLBACK. But apparently, invariantWTOK makes use of wtRCToStatus which still throws WriteConflictException on WT_ROLLBACK.

      The function getLatestOplogTimestamp is called as part of the destructor of LastOpFixer. And so an uncaught WriteConflictException would crash the server as destructors are implicitly noexcept.

      Either we should handle/retry this at the caller ReplicationCoordinatorImpl::getLatestWriteOpTime or inside WiredTigerRecordStore::getLatestOplogTimestamp, assuming replClientInfo().setLastOpToSystemLastOpTimeIgnoringCtxInterrupted(_opCtx) inside ~LastOpFixer is never called inside a bigger WT write transaction.

            Assignee:
            gregory.noma@mongodb.com Gregory Noma
            Reporter:
            lingzhi.deng@mongodb.com Lingzhi Deng
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved: