You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "adarshsanjeev (via GitHub)" <gi...@apache.org> on 2024/03/04 13:03:19 UTC
[PR] Make servedSegments nullable to maintain compatibility (druid)
adarshsanjeev opened a new pull request, #16034:
URL: https://github.com/apache/druid/pull/16034
This marks `servedSegments` as `Nullable` to make it backward compatible with older workers and controllers in the case of a rolling upgrade. Null checks are also added to where these values are used in the code.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Make servedSegments nullable to maintain compatibility (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe merged PR #16034:
URL: https://github.com/apache/druid/pull/16034
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Make servedSegments nullable to maintain compatibility (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on code in PR #16034:
URL: https://github.com/apache/druid/pull/16034#discussion_r1512181804
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/table/SegmentsInputSliceTest.java:
##########
@@ -78,6 +78,31 @@ public void testSerde() throws Exception
);
}
+ @Test
+ public void testSerde2() throws Exception
+ {
+ final ObjectMapper mapper = TestHelper.makeJsonMapper()
+ .registerModules(new MSQIndexingModule().getJacksonModules());
+
+ final SegmentsInputSlice slice = new SegmentsInputSlice(
+ "myds",
+ ImmutableList.of(
+ new RichSegmentDescriptor(
+ Intervals.of("2000/P1M"),
+ Intervals.of("2000/P1M"),
+ "1",
+ 0
+ )
+ ),
+ null
+ );
+
+ Assert.assertEquals(
+ slice,
+ mapper.readValue(mapper.writeValueAsString(slice), InputSlice.class)
Review Comment:
We would want to have a handCreated pojo without the key ` @JsonProperty("servedSegments"` rite ? because that would be sent over the write from the old controller.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Make servedSegments nullable to maintain compatibility (druid)
Posted by "cryptoe (via GitHub)" <gi...@apache.org>.
cryptoe commented on PR #16034:
URL: https://github.com/apache/druid/pull/16034#issuecomment-1980702618
Removed the 29.0.1 since the base PR was not merged in 29.0.0.
Thanks @adarshsanjeev for the catch.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org
Re: [PR] Make servedSegments nullable to maintain compatibility (druid)
Posted by "adarshsanjeev (via GitHub)" <gi...@apache.org>.
adarshsanjeev commented on code in PR #16034:
URL: https://github.com/apache/druid/pull/16034#discussion_r1512244018
##########
extensions-core/multi-stage-query/src/test/java/org/apache/druid/msq/input/table/SegmentsInputSliceTest.java:
##########
@@ -78,6 +78,31 @@ public void testSerde() throws Exception
);
}
+ @Test
+ public void testSerde2() throws Exception
+ {
+ final ObjectMapper mapper = TestHelper.makeJsonMapper()
+ .registerModules(new MSQIndexingModule().getJacksonModules());
+
+ final SegmentsInputSlice slice = new SegmentsInputSlice(
+ "myds",
+ ImmutableList.of(
+ new RichSegmentDescriptor(
+ Intervals.of("2000/P1M"),
+ Intervals.of("2000/P1M"),
+ "1",
+ 0
+ )
+ ),
+ null
+ );
+
+ Assert.assertEquals(
+ slice,
+ mapper.readValue(mapper.writeValueAsString(slice), InputSlice.class)
Review Comment:
Changed the test case
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org