-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Server Serverless 2022-02-07, Server Serverless 2022-04-18, Server Serverless 2022-05-02, Server Serverless 2022-05-16, Server Serverless 2022-05-30, Server Serverless 2022-06-13
The insert path calls OpObserver::onInserts() (here and here) in order to log an op in the oplog.
OpObserverImpl::onInserts() constructs oplog entries differently depending on whether the op is part of a multi-document transaction or not. If it is part of a transaction, we construct the oplog entry by calling MutableOplogEntry::makeInsertOperation. In MutableOplogEntry::makeInsertOperation, set the "tid" field on the ReplOperation constructed there using the tenantId on the NamespaceString passed in if featureFlagRequireTenantId is set. If the op is not part of a transaction, we construct the entry directly and can just set the tid field here (again only set it if featureFlagRequireTenantId is set). We can grab the tenantId from the NamespaceString object passed in.
Let's add a test case to the OpObserverImplTest and check that OpObserverImpl::onInserts() behaves as expected when called both in a multi-document transaction and not.
- depends on
-
SERVER-64608 Add tenantID to NamespaceString
- Closed