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

Remove BatchWriteOp _targeted member

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Sharding
    • Fully Compatible
    • Repl 2023-10-16, Repl 2023-10-30

      BatchWriteOp has a _targeted member that is stated to be for tracking purposes: https://github.com/mongodb/mongo/blob/7f42924bf009ec67df3b2d8e32d56bb387037c27/src/mongo/s/write_ops/batch_write_op.h#L237C1-L237C1 

      However, as far as I can tell we never actually write to or store anything in _targeted and we never actually read anything in it.

      The only references appear to be: 

      • in the method forgetTargetedBatchesOnTransactionAbortingError we clear it. this is called from a few places
      • we attempt to remove a batch from it in BatchWriteOp::noteBatchResponse 

      Given this it seems like dead code, so unless if it is a bug that we don't write to or read from it, we should remove it.

            kaitlin.mahar@mongodb.com Kaitlin Mahar
            kaitlin.mahar@mongodb.com Kaitlin Mahar
            0 Vote for this issue
            3 Start watching this issue