[SERVER-18869] Make mongoS collstats aware of $gleStats section in mongoD responses Created: 08/Jun/15  Updated: 13/Jun/22  Resolved: 13/Jun/22

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

Type: Improvement Priority: Minor - P4
Reporter: Alexander Komyagin Assignee: Andrew Witten (Inactive)
Resolution: Cannot Reproduce Votes: 6
Labels: neweng, sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Participants:
Story Points: 2

 Description   

Currently mongoS logs a warning "mongos collstats doesn't know about: $gleStats" when collstats is executed, because the code in "src/mongo/s/commands_public.cpp:1210" doesn't list that field.

Alternatively, we may want to restructure the code to eliminate the need of explicit listing of all mongoD response fields. mongoS should be only aware of those that need special handling, like indexsizes and number of documents.



 Comments   
Comment by Andrew Witten (Inactive) [ 13/Jun/22 ]

I am closing this as can't reproduce, because the following test doesn't produce a complaint about $gleStats:

 

(function() {
    var s = new ShardingTest({
        shards: 2,
        rs: {nodes: 3}
    });
    s.getDB("test").foo.insert({x: 1});
    assert.commandWorked(        s.getDB("admin").runCommand({setParameter: 1, logLevel: 5}));
    let res = assert.commandWorked(s.getDB("test").runCommand({collStats: "foo"}));
    jsTestLog(tojson(res))
    assert(!rawMongoProgramOutput().includes("gleStats"))
    s.stop()}()
) 

 

However, I do see the following logs:

[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"numOrphanDocs"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"freeStorageSize"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"indexBuilds"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"scaleFactor"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"lastCommittedOpTime"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"$clusterTime"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"$configTime"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.175+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"$topologyTime"}}
 
[js_test:collstats] s20029| {"t":{"$date":"2022-06-13T19:46:42.176+00:00"},"s":"I",  "c":"COMMAND",  "id":22749,   "ctx":"conn12","msg":"Unexpected field for mongos collStats","attr":{"fieldName":"operationTime"}} 

 

I have created  SERVER-67245 to make this less noisy.

Comment by Kshitij Gupta [ 30/Nov/21 ]

Looking into src/mongo/s/commands/cluster_coll_stats_cmd.cpp might be more relevant now than looking at the file in the original ticket while investigating this ticket.

Comment by Lamont Nelson [ 30/Nov/21 ]

We will verify if this is still an issue and update the level of effort if so.

Comment by Kaloian Manassiev [ 15/Nov/21 ]

This is a simple low-hanging fruit which will reduce the amount of logging noise on MongoS. Putting it on NYC's backlog since it is not related to the catalog.

Comment by Dave Muysson [ 06/Jan/16 ]

We call 'collstats' regularly to pull internal collection data metrics into a third party tool.

The fact that this warning is thrown into the mongos log every time collstats is run is ballooning the MongoS logs. It's also captured by our log consolidation tools which pull warnings, errors, etc, logged by various processes (such as mongos). This clutters up the logs, and will require explicit filtering to get rid of it.

If the issue isn't going to be fixed (i.e. stop logging the warning if this is expected behaviour), could it at least be moved to informational?

Thank you

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