-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Switch to Standard UUID representation #5034
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -162,7 +162,7 @@ protected MongoClientSettings computeClientSetting() { | |
getOrDefault(port, "" + ServerAddress.defaultPort()))); | ||
|
||
Builder builder = MongoClientSettings.builder().applyConnectionString(connectionString); | ||
builder.uuidRepresentation(UuidRepresentation.JAVA_LEGACY); | ||
builder.uuidRepresentation(UuidRepresentation.STANDARD); | ||
|
||
if (mongoClientSettings != null) { | ||
|
||
|
@@ -291,7 +291,7 @@ protected MongoClientSettings computeClientSetting() { | |
applySettings(builder::retryWrites, computeSettingsValue(defaultSettings.getRetryWrites(), | ||
mongoClientSettings.getRetryWrites(), connectionString.getRetryWritesValue())); | ||
applySettings(builder::uuidRepresentation, | ||
computeSettingsValue(null, mongoClientSettings.getUuidRepresentation(), UuidRepresentation.JAVA_LEGACY)); | ||
computeSettingsValue(null, mongoClientSettings.getUuidRepresentation(), UuidRepresentation.STANDARD)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we use here constants and not There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. guess we're missing a test here - let's align with the above and add the test for it |
||
} | ||
|
||
if (!CollectionUtils.isEmpty(credential)) { | ||
|
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.
The GH Issue says
To do that, shouldn't this be changed to
UuidRepresentation.UNSPECIFIED
?The risk of changing from
JAVA_LEGACY
toSTANDARD
is that applications with existing data can end up with a mix of UUID representations for the same field in the same collection, and then have a very difficult time querying their data.Uh oh!
There was an error while loading. Please reload this page.
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 filed #5037 to track the further progress. Removing defaulting and failing early (instead of a delayed failure during save/query) would be an ideal signal to require additional configuration from the application. Removing defaults is going to create quite some inconvenience during upgrade.
Another alternative could be leaving defaults as-is but issuing warn logging if the default value is implicitly (i.e. not explicitly configured) used.
Also, I updated the original ticket description.