[SERVER-62781] Include "tid" in oplog entries for commands Created: 20/Jan/22  Updated: 29/Oct/23  Resolved: 14/Jul/22

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

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Hugh Tong (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-71797 Move definition of MutableOplogEntry:... Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-06-13, Server Serverless 2022-06-27, Server Serverless 2022-07-11, Server Serverless 2022-07-25
Participants:

 Description   

Change the following functions on OpObserver to take in DatabaseName rather than a string for dbName:

  • onDropDatabase
  • onApplyOps

Set the "tid" field in the oplog entry for each of the follow commands using the tenantId on the NamespaceString or DatabaseName object passed in (i.e. OpObserverImpl::onStartIndexBuild).

  • onCreateIndex
  • onStartIndexBuild
  • onCommitIndexBuild
  • onAbortIndexBuild
  • onInternalOpMessage
  • onCollMod
  • onDropCollection
  • onDropIndex
  • onEmptyCapped
  • onImportCollection
  • preRenameCollection
  • postRenameCollection
  • onRenameCollection
  • onDropDatabase
  • onApplyOps

Be sure not to include the tenantID in the "ns" field in any oplog entries (i.e. like here in onCreateIndex). There are some commands that log namespaces in fields other than "ns" as well, be sure not to include the tenantID in these either:
Special cases:

We can again add tests to OpObserverTest, though we probably don't need to add a test case for every command.



 Comments   
Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Hugh Tong', 'email': 'hugh.tong@mongodb.com', 'username': 'cortrain'}

Message: SERVER-62781 Include tid in oplog entries for commands
Branch: master
https://github.com/mongodb/mongo/commit/d4f322da12a6a52b1f32c39187f04b961f8cf206

Comment by Githook User [ 11/Jul/22 ]

Author:

{'name': 'Hugh Tong', 'email': 'hugh.tong@mongodb.com', 'username': 'cortrain'}

Message: SERVER-62781 Include "tid" in oplog entries for commands
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/28dab72d726477c8ef482566385441eec5db9485

Generated at Thu Feb 08 05:56:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.