Skip to content

Conversation

FGasper
Copy link
Collaborator

@FGasper FGasper commented Aug 20, 2025

PR #127 merged before review was finished. This changeset addresses an outstanding item that the last PR left unresolved: specifically, the computed document key will now always include a value for each field in the shard key, even if the field is not present in the document.

Another commit fixes a flap in that other PR’s test.

Both commits will be preserved in the merge.

@FGasper FGasper changed the title Switch doc key to fill in null values. REP-6465 Switch doc key to fill in null values. Aug 20, 2025
@FGasper FGasper force-pushed the felipe_simpler_doc_key branch 5 times, most recently from 0b2f6a9 to 10c76c2 Compare August 22, 2025 18:16
@FGasper FGasper requested a review from mmcclimon August 22, 2025 18:17
Copy link
Collaborator

@mmcclimon mmcclimon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is much simpler, thanks! LGTM % one thing you can take or leave.

Comment on lines 72 to 77
bson.M{"_id": ns},
bson.M{
"$set": bson.M{
"noBalance": true,
},
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(nit) It doesn't really matter since these are single-value maps, but shouldn't these be bson.Ds instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This amends PR mongodb-labs#127 so that, if a document lacks a shard key field, the
generated document key will include that field with a null value. This
matches the server’s internal logic and seems safer besides.
This fixes intermittent failures in PR mongodb-labs#127’s new dotted-key sharding test.
@FGasper FGasper force-pushed the felipe_simpler_doc_key branch from 10c76c2 to 351801a Compare August 22, 2025 20:54
@FGasper FGasper merged commit 13a1b2d into mongodb-labs:main Aug 22, 2025
98 checks passed
@FGasper FGasper deleted the felipe_simpler_doc_key branch August 22, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants