[SERVER-80218] Timeseries findAndModify uses the internal bucket namespace for profiling output instead of the user-aware namespace Created: 17/Aug/23  Updated: 29/Oct/23  Resolved: 03/Oct/23

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

Type: Bug Priority: Major - P3
Reporter: Wenbin Zhu Assignee: Yuhong Zhang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution NAMER
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution NAMR Team 2023-10-02, Execution NAMR Team 2023-10-16
Participants:

 Description   

The ns field in the time-series findAndModify profile output is using the internal bucket collection name instead of the user collection name:

{
	"op" : "command",
	"ns" : "test.system.buckets.weather",  // Instead of test.weather
	"command" : {
		"findAndModify" : "weather",
                ...
        }
        ...
} 

This is because in the findAndModify code, we set CurOp's `ns` using nsString (which is the bucket namespace if the collection is a time-series) instead of the nss (which comes from the client request).
 
I think this could be a problem because
1) It's inconsistent with insert/update/delete where we use the user collection name
2) User should not be aware of the bucket collection.
 
Additionally it seems that if the findAndModify request comes from mongos where it uses the two phase protocol, even the namespace in the request will be modified to use the bucket collection name, which means that we may need to translate it back to the user collection name for profiling on mongod.
 
If we are going to fix this, we may also need to fix some tests which expect profiling outputs to have entries with the bucket namespace.



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

Author:

{'name': 'Yuhong Zhang', 'email': 'yuhong.zhang@mongodb.com', 'username': 'YuhongZhang98'}

Message: SERVER-80218 Use time-series view namespace for profiling for sharded findAndModify
Branch: master
https://github.com/mongodb/mongo/commit/0470ef089befbeb315f759f704e7ad5bb183574b

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