[DOCS-11050] db.collection.stats metrics are not all sync'd after the call to validate Created: 22/Nov/17  Updated: 13/Nov/23  Resolved: 09/Feb/22

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: 4.2.0, 4.4.0, 5.0.0, 5.2.0, 5.3.0, Server_Docs_20231030, Server_Docs_20231106, Server_Docs_20231105, Server_Docs_20231113

Type: Improvement Priority: Major - P3
Reporter: Arnie Listhaus Assignee: Jason Price
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 2 years, 1 day ago
Epic Link: DOCSP-11701
Story Points: 3

 Description   

The collstats documentation states:


After an unclean shutdown of a mongod using the Wired Tiger storage engine, size statistics reported by collStats may be inaccurate.

The amount of drift depends on the number of insert, update, or delete operations performed between the last checkpoint and the unclean shutdown. Checkpoints usually occur every 60 seconds. However, mongod instances running with non-default --syncdelay settings may have more or less frequent checkpoints.

Run validate on each collection on the mongod to to restore the correct statistics after an unclean shutdown.


The final paragraph implies that all statistics will be trued up after validate is run. However, this is not the case.

In terms of count: `validate()` will only true up the fast count if it is off as the result of an unclean shutdown. In general usage the fast count in WT should be considered an estimate (particularly if there are active writes to a collection)

Moreover, other metrics like the number of documents inserted or removed will not be trued up either.

Please update the documentation to clarify what is guaranteed to be accurate after a call to validate.



 Comments   
Comment by Githook User [ 09/Feb/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-11050 collection stats metrics sync (#550) (#579)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.2
https://github.com/10gen/docs-mongodb-internal/commit/b9c41e8e4bf5b1840f2d2cc3d892df0c98a543d0

Comment by Githook User [ 09/Feb/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-11050 collection stats metrics sync (#550) (#578)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v4.4
https://github.com/10gen/docs-mongodb-internal/commit/e65e95b6861767bd2d19df8a02069cd3a7230bfa

Comment by Githook User [ 08/Feb/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-11050 collection stats metrics sync (#550) (#577)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.0
https://github.com/10gen/docs-mongodb-internal/commit/40029267d66a256467ad2562d1572f076b9e95b5

Comment by Githook User [ 08/Feb/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-11050 collection stats metrics sync (#550) (#576)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: v5.2
https://github.com/10gen/docs-mongodb-internal/commit/00a9d73d59a5bd5b2ba84226a41ce14fc4f7e5cf

Comment by Githook User [ 08/Feb/22 ]

Author:

{'name': 'jason-price-mongodb', 'email': '69260375+jason-price-mongodb@users.noreply.github.com', 'username': 'jason-price-mongodb'}

Message: DOCS-11050 collection stats metrics sync (#550)

Co-authored-by: jason-price-mongodb <jshfjghsdfgjsdjh@aolsdjfhkjsdhfkjsdf.com>
Branch: master
https://github.com/10gen/docs-mongodb-internal/commit/0e71f9db78b69b355a71865f8900259220b8d3d8

Comment by Bruce Lucas (Inactive) [ 27/Nov/17 ]

Moreover, other metrics like the number of documents inserted or removed will not be trued up either.

Note that there's nothing for validate to true up for these metrics as they are explicitly, like all operation counters, counts of inserts and removes since the mongod process was started. This is implicit in the note under the "metrics" heading

A document that returns various statistics that reflect the current use and state of a running mongod instance.

This could be clarified to indicate that this means that all of these metrics start at 0 each time mongod is started.

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