-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
(copied to CRM)
Once a replica set member terminates abruptly, a number of documents for a collection (that the db.coll.estimatedDocumentCount() returns) may be afftected. This introduces a permanent skew for that collection.
The only way to fix this at the moment is to run the validate() operation or perform an initial sync.
Given the widespread adoption of Kubernetes, this increases the changes of abnormal termination of mongod processes, resulting in skewed counts. Since skewed results are replica set member-unique, this introduces a challenge for applications that are using the primaryPreferred read preference and a single-DC deployment topology: the count results may "flip-flop" since the writes may hit different replica set members.
The improvement here would be to provide a tool that fixes the affected metadata counter faster, comparing to options available today (validate() and initial sync).