[SERVER-39114] Missing appName info Created: 22/Jan/19  Updated: 08/Jan/24

Status: Open
Project: Core Server
Component/s: Diagnostics, Sharding
Affects Version/s: 3.4.17, 3.4.18
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Anthony Brodard Assignee: Backlog - Service Architecture
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File appName.json     File appNameMissing.json    
Issue Links:
Depends
depends on SERVER-43576 DBClientRS does not propagate applica... Closed
Related
is related to SERVER-45141 Make a test suite which always provid... Closed
is related to SERVER-45142 Provide a failPoint which causes a la... Closed
Assigned Teams:
Service Arch
Operating System: ALL
Sprint: Security 2019-02-11, Security 2019-02-25, Security 2019-03-11, Security 2019-03-25, Security 2019-04-08, Security 2019-04-22, Security 2019-05-06, Security 2019-05-20, Security 2019-06-03, Security 2019-07-01, Security 2019-09-09, Security 2019-09-23, Security 2019-10-07, Security 2019-10-21, Security 2019-11-04
Participants:

 Description   

Hi there,

 

We're using a custom application to collect and store the slow queries on our MongoDB deployments. We're using the `appName` to identify the applications making slow queries.

We're noticing missing `appName` on some queries. We did many tests on our side to isolate and replicate the issue :

  • That's not query specific : the same query, coming from the same application, can be reported with and without the query
  • On this application, we're 100% sure the `appName` is set
  • The issue is not coming from our application : the `appName` is missing on the profiler too (I can share the profiler output privately)

We didn't find any related issue on the changelogs.

We're noticing the issue from different drivers : `globalsign/mgo`, official NodeJS and official PHP.

Can you tell us if we're missing something, or is there an issue on mongod side ? FYI, we noticed the issue only on our sharded clusters. As our replica set are less used, and less slow queries are reported on them, we don't know if there is a similar problem or not.

 

Thanks,

Anthony

 



 Comments   
Comment by Lauren Lewis (Inactive) [ 09/Nov/21 ]

We haven’t heard back from you for some time, so I’m going to close this ticket. If this is still an issue for you, please provide additional information and we will reopen the ticket.

Comment by Mira Carey [ 13/Dec/19 ]

I haven't been able to discover any codepaths that don't propagate application name and expect that this problem has been largely solved in later versions of mongos (as we've converted larger portions of the sharding codebase to use the same primitives, which do correctly propagate).

I've filed SERVER-45141 to investigate spinning up a test suite to verify that, but don't have any further updates at this time

Comment by Mark Benvenuto [ 08/Nov/19 ]

I have not been able to find the place in the code where "Application Name" is being lost by MongoS as part remote network request mechanism. I have been doing all my investigation on 4.2 but as someone suggested to me today, this may have gone away.

Now, the remote request handling is tricky (https://github.com/mongodb/mongo/blob/master/src/mongo/executor/remote_command_request.h#L70-L77) because when I wrote the feature, I did not retrofit the entire product, only the user facing portions (i.e. I skipped internal generated queries by replication and sharding)

I have a private branch were I instrumented our currentOp code to invariant whenever a query is received without app name but I have not found any cases from a mongos to mongod with our test suites. I found one issue (SERVER-43576) when the shell is initialized with a replica set URI but this is not the original case in this bug.

Branch:
https://github.com/markbenvenuto/mongo/tree/clientmd_missing_assert

I going to assign this to the sharding team to see if they can offer an insight.

Comment by Samat Yusupov [ 15/Jul/19 ]

Hello! Watching the same issue. I'm using mongodb 3.4.17 with replicaSet and nodejs driver.
Do you have any updates on this?

Comment by Danny Hatcher (Inactive) [ 23/Jan/19 ]

Hello Anthony,

Thank you for the information that you've provided thus far. I've forwarded this ticket on to the appropriate team to take a look.

Danny

Comment by Anthony Brodard [ 22/Jan/19 ]

We were affected by  SERVER-34141 and I confirm this issue have been fixed in version > 3.4.17.

We are seeing the missing appName on our two clusters, one is running in 3.4.17, the other one in 3.4.18.

About the drivers, we using 

  • globalsign/mgo - r2018.06.15
  • ext-mongodb - 1.4.*
  • loopback-connector-mongodb - 3.4.3
Comment by Danny Hatcher (Inactive) [ 22/Jan/19 ]

Hello Anthony,

It is possible that you experiencing SERVER-34141 but that should have been fixed in 3.4.17. In the initial creation of this ticket you set the "Affects Version" field to 3.4.17 and 3.4.18. Can you please confirm what version of MongoDB you are running in this environment as well as the driver(s) you are using to perform the queries that generate these slowOp entries?

Thank you,

Danny

Comment by Anthony Brodard [ 22/Jan/19 ]

HI Danny

> How is your application gathering the appName from slow MongoDB queries? Are you simply parsing through the mongod/mongos log files, the slow query profiler, or are you using another method?

Our application is only based on the db.currentOp() command output. We used the profiler to isolate the issue, and exclude an error on our application side.

 

Please find attached the profiler output. There coming from the same process. The appName is defined in "appName.json" (L216), not in "appNameMissing.json".

Please let me know if you need more information about our setup.

 

Regards,

Anthony 

 

Comment by Danny Hatcher (Inactive) [ 22/Jan/19 ]

Hello Anthony,

How is your application gathering the appName from slow MongoDB queries? Are you simply parsing through the mongod/mongos log files, the slow query profiler, or are you using another method? Could you provide an example output of a query that sometimes shows correctly and sometimes does not? I do not believe the actual fields being queried are important so feel free to redact that information.

Thank you,

Danny

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