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

Natural Order Resharding Pipeline Can Attempt to Write Empty Batch

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • Labels:
      None
    • Replication
    • ALL
    • v7.1
    • 148

      The logic to write a batch in ReshardingCollectionCloner::doOneBatch was recently split into another writeOneBatch function, which is called from the path using the natural order pipeline. However, the natural order pipeline does not guard against attempt to write a batch with size 0, whereas the original code path does.

      It's possible if the batch returned by the cursor is size 0, then we eventually call getNextOpTimes() with count = 0, which will trigger an invariant in _advanceComponentTimeByTicks when we try to increment the vector clock by 0 ticks. This is seen in BF-29741.

            Assignee:
            backlog-server-repl [DO NOT USE] Backlog - Replication Team
            Reporter:
            brett.nawrocki@mongodb.com Brett Nawrocki
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: