[SERVER-57925] Refactor DBClientBase API not to use flags bit vector Created: 22/Jun/21  Updated: 28/Jun/22  Resolved: 28/Jun/22

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

Type: Task Priority: Major - P3
Reporter: Irina Yatsenko (Inactive) Assignee: Irina Yatsenko (Inactive)
Resolution: Done Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:

 Description   

According to David Storch, the "flags" bit vector is a bit of an artifact of the old wire protocol, since OP_INSERT, OP_DELETE, and OP_UPDATE each included such a bit vector. We could modernize the DBClientBase API now to use enums or named arguments instead.



 Comments   
Comment by Mickey Winters [ 28/Jun/22 ]

fixed by irina in https://github.com/mongodb/mongo/commit/1f64d42977db0572b08d7ab19133bc3f21323ce0

Comment by David Storch [ 28/Jun/21 ]

ethan.zhang I also had trouble finding many callers that actually pass a non-default value for flags with a cursory search of the code base. That's good news, since it means that this ticket hopefully wouldn't require changes to a large number of call sites. However, I think there are at least a handful that would need to change. For example, here's one which was recently modified by Irina's patch for SERVER-57459:

https://github.com/mongodb/mongo/blob/1a78afe4e8a97d21e99f39504bd2ef451f1d7fa7/src/mongo/dbtests/directclienttests.cpp#L79

Comment by Ethan Zhang (Inactive) [ 22/Jun/21 ]

david.storch Can you point me to an example? I don't know why I was not able to find callers for this in the codebase.

Comment by David Storch [ 22/Jun/21 ]

ethan.zhang this is an internal API used by the shell and for communication between nodes in the cluster. It would not have any downstream impact.

Comment by Ethan Zhang (Inactive) [ 22/Jun/21 ]

Who are the callers for those methods with flags? Drivers? Modernizing them may have downstream impacts?
http://10.1.2.40/mongodb/source/src/mongo/client/dbclient_base.cpp#946

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