[SERVER-42070] Print the actual diff in collStats output when checkDBHashesForReplSet() detects collStats discrepancy Created: 03/Jul/19  Updated: 06/Dec/22

Status: Backlog
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: Backlog - Server Tooling and Methods (STM) (Inactive)
Resolution: Unresolved Votes: 0
Labels: tig-mongorunner, tig-qwin-eligible
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
Related
Assigned Teams:
Server Tooling & Methods
Participants:
Linked BF Score: 14

 Description   

Currently, the RollbackFuzzer calls dumpCollectionDiff() when it detects a mismatch in collection stats for any of the fields "capped", "nindexes", or "ns". It does not, however, tell you which of the fields actually had a mismatch, and the dumpCollectionDiff() function only shows collection document differences anyway.
I don't think it's helpful to call dumpCollectionDiff() for this failure case. Instead, it should just display the output of collStats for each node, and also display the actual fields that triggered the problem. The output of collStats is enormous and is output to a single line, making a determination of the failure reason unusually difficult.

You can see an example of this in https://logkeeper.mongodb.org/build/222903c574e9dc03a763ab16015f31f8/test/5d1a64fec2ab684c9109a185?html=1#L20988



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Comment by William Schultz (Inactive) [ 31/Jul/19 ]

See linked BF for another example of a large collStats object being printed when a mismatch is found.

Comment by Eric Milkie [ 31/Jul/19 ]

Yes, just those fields would be even better, as long as you think those will continue to be the only fields that matter in the comparison.

Comment by Max Hirschhorn [ 31/Jul/19 ]

milkie, william.schultz, is displaying all of the collStats output in the dumpCollectionDiff() function actually helpful? I'm wonder if we would rather just pluck the capped, nindexes, and ns fields that are actually being compared.

https://github.com/mongodb/mongo/blob/4958cedd5023aae532f36ad451644304106fc84d/src/mongo/shell/replsettest.js#L2040-L2067

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