[SERVER-68550] Change applyOps command path to use DatabaseName object Created: 04/Aug/22  Updated: 29/Oct/23  Resolved: 18/Oct/22

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

Type: Task Priority: Major - P3
Reporter: Sophia Tan Assignee: Didier Nadeau
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-10-03, Server Serverless 2022-10-17, Server Serverless 2022-10-31
Participants:

 Description   

Change the applyOps command to act on a DatabaseName object rather than string. Specifically, change applyOps to take in a DatabaseName object, and pass the DatabaseName object to it from the applyOps command (as well as from any other call sites). We will not allow this command to be run by users (so do not override `allowedWithSecurityToken()` or add a test case to native_tenant_data_isolation_basic_security_token.js). We should add a test case to native_tenant_data_isolation_basic_dollar_tenant.js, however.



 Comments   
Comment by Githook User [ 18/Oct/22 ]

Author:

{'name': 'Didier Nadeau', 'email': 'didier.nadeau@mongodb.com', 'username': 'nadeaudi'}

Message: SERVER-68550 Change applyOps command path to use DatabaseName
Branch: master
https://github.com/mongodb/mongo/commit/e50ed1f5246227e7fb2fce76aba2c4c5822e0b3c

Comment by Didier Nadeau [ 05/Oct/22 ]

Waiting on SERVER-69499 to properly deserialize oplog entries. Currently we need to provide entries such asĀ 
{applyOps: [\{"op": "i", "ns": "123456_myDB.testColl", "o": {_id: 5, x: 17}}], '$tenant': kTenant}
However this is not deserialized properly in oplog_entry.cpp : the DurableOplogEntry constructor looks for the tid field (https://github.com/10gen/mongo/blob/master/src/mongo/db/repl/oplog_entry.cpp#L369) and pass it to the parser, which uses it when creating the NamespaceString. We end up with a nss that has no tid, and the db() is "123456_myDB". Instead it should have a tid of 123456 and a db() of "myDB" : the ns is invalid and comparison with the actual db does not work.

Therefore this is blocked on SERVER-69499 to properly deserialize oplogs.

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