-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
add backwards compat mode for frontCoded stringEncodingStrategy #13988
add backwards compat mode for frontCoded stringEncodingStrategy #13988
Conversation
public void testFrontCodedDefaultSerde() throws JsonProcessingException | ||
{ | ||
StringEncodingStrategy frontCoded = new StringEncodingStrategy.FrontCoded(null, null); | ||
String there = JSON_MAPPER.writeValueAsString(frontCoded); | ||
StringEncodingStrategy andBackAgain = JSON_MAPPER.readValue(there, StringEncodingStrategy.class); | ||
Assert.assertEquals(frontCoded, andBackAgain); | ||
} |
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.
How about validate that this does a v1 and add some comments that help indicate that when/if that test breaks, it means default behavior changed and we need to think through the deployment model.
Also, then add a test that explicitly does v1 as well?
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.
added FrontCodedIndexed.DEFAULT_VERSION
(and also moved DEFAULT_BUCKET_SIZE
here), and test for both of them as well as explicit test for v1
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.
Just one small nit. Please, in a comment on StringEncodingStrategyTest.testFrontCodedDefaultSerde
, indicate that a failure there should either also occur in one of the other methods (because they are doing the default behavior too OR it's indicative that the code changed such that the default behavior is now different than it used to be and that we should ensure that the change happening is kosher for compatibility.
Description
Follow up to #13854, to add a backwards compatibility mode for users of Druid 25.0 to upgrade to Druid 26.0 in a manner that allows for errorless rolling upgrades and downgrades by writing out the older format version.
Release noteThefrontCoded
type ofstringEncodingStrategy
onindexSpec
, has been improved with a new segment format version which typically has faster read speeds and reduced segment size. However, this improvement is backwards incompatible with Druid 25.0, so a newformatVersion
option has been added, which defaults to the new1
, but can be specified as0
to allow migration to Druid 26.0 by the way of writing out the older format until the ability to rollback to Druid 25.0 is no longer determined to be needed.This PR has: