-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
OpObserverImpl::onUpdate() has 3 branches, that repeat setting the same fields the same way in each branch. **
- if (inBatchedWrite)
- else if (inMultiDocumentTransaction)
- else
The work done in makeUpdateOperation(), even though the final branch doesn't utilize the helper, is repeated for each branch (tid, nss, uuid and opType, Object, Object2 ).
All branches independently use the same conditions from the args.updateArgs to 'setDestinedRecipient()' (1, 2, 3) and 'setFromMigrateIfTrue()' as well.
In SERVER-78346, to keep changes isolated to the patch, the MutableOplogEntry's 'recordId' field is also set the same in all 3 branches.
This OpObserverImpl::onDelete() also repeats a similar pattern with its usage of the OplogDeleteEntryArgs and MutableOplogEntry::makeDeleteOperation.