New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TOOLS-3411 Fix issue where sort order of views was not always preserved on dump #618
Conversation
{Key: "score", Value: 1}, | ||
}}}, | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that the original bug of reordering is probabilistic, can we shuffle the pipeline in this test to test different orderings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make the test reliably fail when there is an issue by just running the body of the test in a loop, which might be a bit easier than trying to shuffle the bson? What do you think about that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, LGTM
Fixes an issue where
mongodump
did not always preserve the order of options for a view or collection. This could result in different sort orders than expected on views. It is easily fixed by moving from the unorderedbson.M
type to the orderedbson.D
type for collection options. Index options are still abson.M
, but the keys arebson.D
so they are not affected by this issue.I tested manually by viewing the metadata JSON files produced by
mongodump
on both this branch and master. I also verified that the added test succeeds every time on this branch, but fails most of the time on master.