[SERVER-80998] Remove BatchWriteOp _targeted member Created: 12/Sep/23  Updated: 29/Oct/23  Resolved: 17/Oct/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Kaitlin Mahar Assignee: Kaitlin Mahar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding
Backwards Compatibility: Fully Compatible
Sprint: Repl 2023-10-16, Repl 2023-10-30
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 17/Oct/23 ]

Author:

{'name': 'Kaitlin Mahar', 'email': 'kaitlin.mahar@mongodb.com', 'username': 'kmahar'}

Message: SERVER-80998 Remove unused _targeted member from BatchWriteOp
Branch: master
https://github.com/mongodb/mongo/commit/5a15c9c1cf39ebf6ee9f07655239a690368e32dc

Comment by Ryan Scott [ 15/Sep/23 ]

Sharding NY is happy for you to do this, kaitlin.mahar@mongodb.com. Please add jason.zhang@mongodb.com or abdul.qadeer@mongodb.com as a code reviewer for this. Thanks! 

Generated at Thu Feb 08 06:45:10 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.