Improve Async oplog sampling logging

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Engines, Storage Engines - Server Integration
    • Fully Compatible
    • Omnomlog - 2025-11-11
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      During local testing of the async oplog sampling, I noticed that in our mongod logs we never print out sampling asynchronously: true

      This is due to the fact that, we never hit the createOplogTruncateMarkers method with gOplogSamplingAsyncEnabled == true, due to the below logic:

          // If the server was started in read-only mode, if we are restoring the node, or if async
          // sampling is enabled, skip calculating the oplog truncate markers here.
          bool needsTruncateMarkers = opCtx->getServiceContext()->userWritesAllowed() &&
              !storageGlobalParams.repair && !repl::ReplSettings::shouldSkipOplogSampling() &&
              !gOplogSamplingAsyncEnabled;
          if (needsTruncateMarkers) {
              _truncateMarkers = OplogTruncateMarkers::createOplogTruncateMarkers(opCtx, *rs);
          } 

      The proposal:
      Can we improve our logging to log "sampling asynchronously: true" case?

            Assignee:
            Clarisse Cheah
            Reporter:
            Chuck Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: