[SERVER-49336] Set client metadata if it is missing during failCommand Created: 07/Jul/20  Updated: 29/Oct/23  Resolved: 15/Oct/20

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.9.0, 4.2.15, 4.4.7

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

Issue Links:
Backports
Depends
is depended on by SERVER-49220 failCommand with appName does not fai... Closed
Duplicate
is duplicated by SERVER-48932 ReplicaSetMonitor hitting failpoint s... Closed
is duplicated by SERVER-49220 failCommand with appName does not fai... Closed
is duplicated by SERVER-49815 mongos attach user client metadata to... Closed
is duplicated by SERVER-50804 Make external (application) client in... Closed
Problem/Incident
causes SERVER-56935 "ClientMetadata was previously set" i... Closed
Related
related to SERVER-50517 Rename ClientMetadataIsMasterState to... Closed
related to SERVER-50804 Make external (application) client in... Closed
is related to SERVER-53334 Hitting unexpected invariant failure,... Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.4, v4.2
Sprint: Service arch 2020-10-19
Participants:
Linked BF Score: 133

 Description   

We set the ClientIsMasterMetadataState with appName here. Unfortunately, that happens after we evaluate failCommand here, so the first isMaster cannot have appName filters be applied to it.

The full solution is most likely to separate parse() from run() for isMaster. However, that is potentially disruptive to backport. The less intrusive answer is to separate the functionality that sets the metadata into its own function. We can then invoke that function in failCommand if we don't have client metadata.



 Comments   
Comment by Githook User [ 12/May/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-49336 Set ClientMetadata before CommandInvocations are run
Branch: v4.2
https://github.com/mongodb/mongo/commit/a696566eae01ed989738f36e396ef2ec3949728c

Comment by Githook User [ 10/May/21 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-49336 Set ClientMetadata before CommandInvocations are run
Branch: v4.4
https://github.com/mongodb/mongo/commit/aebce0e3fd8fa0ba88d025c8b8bec3734cd7f10d

Comment by Benjamin Caimano (Inactive) [ 04/Feb/21 ]

shane.harvey, it's reasonable to try to backport it. It's probably not a clean backport though. I've requested backports for v4.4 and v4.2 and Service Arch can determine if they want to do them.

Comment by Shane Harvey [ 04/Feb/21 ]

ben.caimano Is this change something we plan to backport to 4.4 and 4.2? The appName feature was backported to 4.2 in SERVER-47195.

Comment by Githook User [ 20/Oct/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-49336 Allow ClientMetadata to be accessed before it is finalized
Branch: master
https://github.com/mongodb/mongo/commit/77963415a45ac22d3f460c2c4ed8d826c618d719

Comment by Githook User [ 15/Oct/20 ]

Author:

{'name': 'Ben Caimano', 'email': 'ben.caimano@10gen.com'}

Message: SERVER-49336 Set ClientMetadata before CommandInvocations are run

This patch does the following:

Comment by Mira Carey [ 07/Jul/20 ]

I'm signing off on this with the less disruptive approach to aid in backports

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