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

insertDocumentForBulkLoader is only called when isOplogDisabledFor is true

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Storage Execution
    • Execution Team 2024-03-04, Execution Team 2024-03-18, Execution Team 2024-04-01, Execution Team 2024-05-27

      Currently there is code in insertDocumentForBulkLoader that checks for when replCoord->isOplogDisabledFor(...) returns false, here.

      I looked for callers of the insertDocumentForBulkLoader function and it seems it's only called from CollectionCloner, which is only used in initial sync. So that means that there won't ever be a case where isOplogDisabledFor returns false, as the oplog is disabled during initial sync.

      A patch with the following added to it ran successfully:

      invariant(replCoord->isOplogDisabledFor(opCtx, nss));
      

      So we should be able to simplify that function since we are sure that it's only called in the initial sync context (for example, we can remove the check linked above).

            Assignee:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Reporter:
            vishnu.kaushik@mongodb.com Vishnu Kaushik
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: