Revert "KAFKA-16154" and mark MV 3.8-IV0 as the latest production#16400
Revert "KAFKA-16154" and mark MV 3.8-IV0 as the latest production#16400jlprat merged 11 commits intoapache:3.8from
Conversation
| } else if (targetTimestamp == ListOffsetsRequest.LATEST_TIERED_TIMESTAMP) { | ||
| if (remoteLogEnabled()) { | ||
| val curHighestRemoteOffset = highestOffsetInRemoteStorage() | ||
|
|
||
| val epochResult: Optional[Integer] = | ||
| if (leaderEpochCache.isDefined) { | ||
| val epochOpt = leaderEpochCache.get.epochForOffset(curHighestRemoteOffset) | ||
| if (epochOpt.isPresent) { | ||
| Optional.of(epochOpt.getAsInt) | ||
| } else if (curHighestRemoteOffset == -1) { | ||
| Optional.of(RecordBatch.NO_PARTITION_LEADER_EPOCH) | ||
| } else { | ||
| Optional.empty() | ||
| } | ||
| } else { | ||
| Optional.empty() | ||
| } | ||
|
|
||
| Some(new TimestampAndOffset(RecordBatch.NO_TIMESTAMP, curHighestRemoteOffset, epochResult)) | ||
| } else { | ||
| Some(new TimestampAndOffset(RecordBatch.NO_TIMESTAMP, -1L, Optional.of(-1))) | ||
| } |
There was a problem hiding this comment.
These and the 8 lines prior were the ones with a conflict when reverting.
|
Build failure contained:
I triggered another build |
| * IT CANNOT BE CHANGED.</strong> | ||
| */ | ||
| public static final MetadataVersion LATEST_PRODUCTION = IBP_3_7_IV4; | ||
| public static final MetadataVersion LATEST_PRODUCTION = IBP_3_8_IV0; |
There was a problem hiding this comment.
- 3.8_IV0 is no longer controlling ELR. We need to change the following comment according to https://github.com/apache/kafka/pull/16347/files#diff-abe728e9704c4c6709c4c3f6fd3908d51219cda55791ac7f103e6042c1d6c298.
// Add ELR related supports (KIP-966).
IBP_3_8_IV0(20, "3.8", "IV0", true),
Also, quite a few tests (e.g. PartitionChangeBuilderTest.java) still reference 3.8_IV0 with the assumption that it's associated with ELR. @cmccabe: Should we bring IBP_3_9_IV0, the new MV associated with ELR to the 3.8 branch or change all those tests related to ELR?
- There are a few tests referring to IBP_3_7_IV4, the previous latest production version. They all need to be changed to the new latest production version IBP_3_8_IV0.
- We need to add a comment above the following line that 3.8.0 is the latest production version in 3.8 line.
There was a problem hiding this comment.
Applied feedback, except for "Should we bring IBP_3_9_IV0, the new MV associated with ELR to the 3.8 branch or change all those tests related to ELR?". I'm waiting for @cmccabe's feedback on this one.
| // TEST_2 released right before MV 4.0-IV0 was released, and it depends on this metadata version | ||
| TEST_2(2, MetadataVersion.IBP_4_0_IV0, Collections.singletonMap(MetadataVersion.FEATURE_NAME, MetadataVersion.IBP_4_0_IV0.featureLevel())); |
There was a problem hiding this comment.
@jolshan I need help understanding this test setup. As far as I could understand, this TEST_2 feature was meant to be released in a future release, given we 3.8 is the current one, I moved it to 4.0. But I think this is not a robust test. Probably I'm missing something else.
There was a problem hiding this comment.
I plan to update this in a future PR. Sorry it is not easy to understand now. If you can push it to 4.0, that would be good for now.
| // Change expected message to reflect latest MetadataVersion (SupportedMaxVersion increases when adding a new version) | ||
| assertEquals("Feature: metadata.version\tSupportedMinVersion: 3.0-IV1\t" + | ||
| "SupportedMaxVersion: 4.0-IV0\tFinalizedVersionLevel: 3.7-IV4\t", outputWithoutEpoch(features.get(1))); | ||
| "SupportedMaxVersion: 4.0-IV0\tFinalizedVersionLevel: 3.8-IV0\t", outputWithoutEpoch(features.get(1))); |
There was a problem hiding this comment.
This needed to change as well as we changed the parameter of the test to 3.8-IV0
|
Build failed with an exception on "streams:upgrade-system-tests-34:test". Rerunning the build |
apache#15213)" This reverts commit 55a6d30
Signed-off-by: Josep Prat <josep.prat@aiven.io>
Signed-off-by: Josep Prat <josep.prat@aiven.io>
Signed-off-by: Josep Prat <josep.prat@aiven.io>
0058068 to
87d0761
Compare
|
Something seems wrong after rebasing. Build hangs and the job gets terminated. |
| // Please move this comment when updating the LATEST_PRODUCTION constant. | ||
| // | ||
|
|
||
| // Introduce version 1 of the GroupVersion feature (KIP-848). |
There was a problem hiding this comment.
Hmm, we removed GroupVersion in 3.8 #16478. Why are we adding it back? The hanging ReplicationQuotasTest is related to this since registerBroker() needs to set MaxSupportedVersion to the latest MV, which is 4.0 now. See a similar change in trunk https://github.com/apache/kafka/pull/16347/files#diff-4f8200cb972ea4c0d08bcfc45e9e4e6295c37a4414b9acd59cc4bb248bc25a1c
There was a problem hiding this comment.
Good pointer, I think this might be the problem. This was probably a wrong conflict resolution during rebasing.
Why this existed and was used in this PR is because due to the test setup for FeaturesTest.
TEST_2 needs to be configured to 4.0 like this https://github.com/apache/kafka/pull/16400/files#diff-10fd2b01213aa0cc1f879b06eb7eaae357e3dbcf8a270660b0eb4fcc78e7a5a1R27
Otherwise these tests fail:
:server-common:test > Gradle Test Executor 4 > FeaturesTest > testDefaultTestVersion(MetadataVersion) > "testDefaultTestVersion(MetadataVersion).metadataVersion=3.8-IV0" FAILED
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
at app//org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
at app//org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:134)
at app//org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:129)
at app//org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:329)
at app//org.apache.kafka.server.common.FeaturesTest.testDefaultTestVersion(FeaturesTest.java:120)
Gradle Test Run :server-common:test > Gradle Test Executor 4 > FeaturesTest > testUnstableTestVersion() FAILED
org.opentest4j.AssertionFailedError: Expected java.lang.IllegalArgumentException to be thrown, but nothing was thrown.
at app//org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:152)
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:73)
at app//org.junit.jupiter.api.AssertThrows.assertThrows(AssertThrows.java:35)
at app//org.junit.jupiter.api.Assertions.assertThrows(Assertions.java:3115)
at app//org.apache.kafka.server.common.FeaturesTest.testUnstableTestVersion(FeaturesTest.java:125)
There was a problem hiding this comment.
I'll remove it, and try to find out how to fix the tests that seem to expect MV 3.8-IV0 to not be the production one.
There was a problem hiding this comment.
I think if you need an unstable version, you can just use 4.0 (or 3.9)
There was a problem hiding this comment.
@jolshan Isn't this what is being done in this PR? So if I add the 4.0, the other tests work, but then ReplicationQuotasTest hangs.
This area is not one that I'm really familiar with.
There was a problem hiding this comment.
Hmm. I'm not sure I follow how the tests are related. I can pull your branch if that helps.
There was a problem hiding this comment.
@jolshan https://github.com/apache/kafka/pull/16400/files#diff-10fd2b01213aa0cc1f879b06eb7eaae357e3dbcf8a270660b0eb4fcc78e7a5a1R27 needs to be configured as 4.0 (or 3.9 for that matter) so the FeaturesTest works. But if I add 4.0 in MetadaVersion then ReplicationQuotasTest.shouldBootstrapTwoBrokersWithLeaderThrottle hangs.
There was a problem hiding this comment.
I think I found a way. I'll push shortly
There was a problem hiding this comment.
It's ok to introduce an unstable 4.0 MV for the TestFeature. We just need to (1) make sure the comment associated with the new MV is correct; (2) change all tests that depend on the latest testing MV. In #16347, we tried to change all relevant tests to use MetadataVersion.latestTesting() so that we don't have to manually change the MV when new unstable MV is added in the future. You can search for all tests that have changed from MetadataVersion.IBP_4_0_IV0 to MetadataVersion.latestTesting() in #16347 and apply them here.
There was a problem hiding this comment.
I did this now for all the changes I belive
|
Since this PR also marks MV 3.8-IV0 as the latest production, it would be useful to update the description of the PR accordingly. |
| .setName(MetadataVersion.FEATURE_NAME) | ||
| .setMinSupportedVersion(MetadataVersion.IBP_3_0_IV1.featureLevel()) | ||
| .setMaxSupportedVersion(MetadataVersion.IBP_3_8_IV0.featureLevel())) | ||
| .setMaxSupportedVersion(MetadataVersion.latestTesting().featureLevel())) |
There was a problem hiding this comment.
This makes the test pass as it disregards the latest version as per #16347
| controlEnv.activeController().registerBroker(ANONYMOUS_CONTEXT, | ||
| new BrokerRegistrationRequestData(). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.IBP_4_0_IV0)). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.latestTesting())). |
|
|
||
| // Introduce version 1 of the GroupVersion feature (KIP-848). | ||
| IBP_4_0_IV0(21, "4.0", "IV0", false); | ||
| IBP_3_9_IV0(21, "3.9", "IV0", false); |
| // If users attempt to use an unstable MetadataVersion, they will get an error. | ||
| // Please move this comment when updating the LATEST_PRODUCTION constant. | ||
| // | ||
| IBP_3_9_IV0(21, "3.9", "IV0", false); |
There was a problem hiding this comment.
- The following comment needs to be moved to IBP_3_9_IV0.
// Add ELR related supports (KIP-966).
- We need to change
isElrSupported()to use IBP_3_9_IV0. - We need to bring all tests referencing IBP_3_9_IV1 for ELR in KAFKA-16968: Make 3.8-IV0 a stable MetadataVersion and create 3.9-IV0 #16347 here.
- We need to bring in the changes in the following tests in KAFKA-16968: Make 3.8-IV0 a stable MetadataVersion and create 3.9-IV0 #16347 for testing latestTesting MV.
ClusterTestExtensionsTest.java
ZkMigrationIntegrationTest.scala
ApiVersionsRequestTest.scala - We need to add IBP_3_9_IV0 to all tests in MetadataVersionTest.java where 4.0-IV0 is used in trunk.
There was a problem hiding this comment.
Thanks @junrao
Would we need to add IBP_3_9_IV1 as well? Or just use the tests for IBP_3_9_IV1 using the IBP_3_9_IV0 enum value?
There was a problem hiding this comment.
Just use the IBP_3_9_IV0 enum value for tests using IBP_3_9_IV1 in trunk since BP_3_9_IV0 is associated with ELR in 3.8.
There was a problem hiding this comment.
I think I brought all necessary changes now
There was a problem hiding this comment.
ELR changed metadata records.
|
|
||
| @ClusterTemplate("testApiVersionsRequestIncludesUnreleasedApisTemplate") | ||
| @ClusterTest(types = Array(Type.KRAFT, Type.CO_KRAFT), serverProperties = Array( | ||
| @ClusterTest(types = Array(Type.KRAFT, Type.CO_KRAFT), metadataVersion = MetadataVersion.IBP_3_9_IV0, serverProperties = Array( |
There was a problem hiding this comment.
ClusterTest in trunk has IBP_3_9_IV0 as default value instead of IBP_3_8_IV0. This took me a while to detect as I didn't understand why this test was failing.
There was a problem hiding this comment.
Actually, ClusterTest.metadataVersion() should default to latest testing MV, which is IBP_3_9_IV0. Could we change that and remove setting metadataVersion in this test and the one above?
jolshan
left a comment
There was a problem hiding this comment.
lgtm as long as the tests look good.
| // If users attempt to use an unstable MetadataVersion, they will get an error. | ||
| // Please move this comment when updating the LATEST_PRODUCTION constant. | ||
| // | ||
| IBP_3_9_IV0(21, "3.9", "IV0", false); |
There was a problem hiding this comment.
ELR changed metadata records.
| setClusterId(active.clusterId()). | ||
| setIncarnationId(Uuid.fromString("kxAT73dKQsitIedpiPtwBA")). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.IBP_3_8_IV0)). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.latestTesting())). |
There was a problem hiding this comment.
testUncleanShutdownBroker() is based on ELR. So we need to change the 4 instances of IBP_3_8_IV0 in it to IBP_3_9_IV0. See #16347
There was a problem hiding this comment.
Indeed, this test was failing. I missed this change.
|
|
||
| @ClusterTemplate("testApiVersionsRequestIncludesUnreleasedApisTemplate") | ||
| @ClusterTest(types = Array(Type.KRAFT, Type.CO_KRAFT), serverProperties = Array( | ||
| @ClusterTest(types = Array(Type.KRAFT, Type.CO_KRAFT), metadataVersion = MetadataVersion.IBP_3_9_IV0, serverProperties = Array( |
There was a problem hiding this comment.
Actually, ClusterTest.metadataVersion() should default to latest testing MV, which is IBP_3_9_IV0. Could we change that and remove setting metadataVersion in this test and the one above?
|
To respond to some of the questions above, overall,
Let me know if you need me specifically to review |
|
Thanks for the review @junrao. Feedback is now applied |
|
Failing tests shouldn't be related to the changes (all tests passed locally) |
jolshan
left a comment
There was a problem hiding this comment.
Reapproving with the latest changes! Thanks Josep.
| setClusterId(active.clusterId()). | ||
| setIncarnationId(Uuid.fromString("kxAT73dKQsitIedpiPtwBA")). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.IBP_3_8_IV0)). | ||
| setFeatures(brokerFeatures(MetadataVersion.IBP_3_0_IV1, MetadataVersion.IBP_3_9_IV0)). |
There was a problem hiding this comment.
Note that ideally, we should use MetadataVersion.latestTesting() here. However, explicitly using IBP_3_9_IV0 works too since it's the latest MV.
|
Merged! Thanks for the reviews! |
LATEST_PRODUCTION version in MetadataVersion.java was updated in both apache#16347 and apache#16400, but it was left unchanged in the system tests.
…pache#16533) LATEST_PRODUCTION version in MetadataVersion.java was updated in both apache#16347 and apache#16400, but it was left unchanged in the system tests. Reviewers: Josep Prat <josep.prat@aiven.io>
This reverts commit 55a6d30
As described in #16347 (comment)
More detailed description of your change,
if necessary. The PR title and PR message become
the squashed commit message, so use a separate
comment to ping reviewers.
Summary of testing strategy (including rationale)
for the feature or bug fix. Unit and/or integration
tests are expected for any behaviour change and
system tests should be considered for larger changes.
Committer Checklist (excluded from commit message)