We have around 100 applications that send appName to a MongoDB Shard and 100 that do not send appName and sometimes MongoDB shows an appName that is not the correct one.
Case 1: When we run a query in the shell sometimes takes the appName from one of the applications it is running. We tested in shell version 3.2.10 by connecting in Mongos 3.4.13 and this happened in the second query executed (the first time was without appName, the second got appName from a random application).
mongos> db.investigation_users.find({teste: 1}) mongos> db.currentOp() "appName" : "fetcherperf-rt1 - Fetcher - 3.0.9" "query" : { "find" : "investigation_users", "filter" : { "teste" : 1 }, "shardVersion" : [ Timestamp(430, 0), ObjectId("5a0a72f8b1199455c0f4b3c2") ] }
Case 2: appName that are no longer used appear in operations of other applications. We had configured an application with the name "devops", but then we changed it to "devops - 1.3.2". The second appName started to appear in the operations, but the "devops" also appeared even with no application sending it anymore..
The attached file is an example of a shell execution and currentOp command showed an appName of an application.