kafka icon indicating copy to clipboard operation
kafka copied to clipboard

MINOR: add ReconfigurableQuorumIntegrationTest

Open cmccabe opened this issue 1 year ago • 3 comments

Add ReconfigurableQuorumIntegrationTest to test creating a cluster with KIP-853 enabled, to verify that the feature flag is set. Also test removing a voter.

In order to make this test work, I needed to allocate ports prior to formatting the storage directories, so that --initial-controllers could be set appropriately. Therefore, I added a new interface to SocketServer, the ServerSocketFactory. In a production situation, this opens a port and binds it. In a unit test, for the CONTROLLER listener, we use the PreboundSocketFactory implementation, which returns a pre-allocated port. This allows the test framework to open the CONTROLLER ports (and know their values) prior to setting up node configurations and formatting the storage directories.

This PR moves TestKit over to using the new PreboundSocketFactoryManager mechanism, but leaves QuorumTestHarness still using the old futures-based mechanism. This was done in order to avoid making the PR bigger. In a follow-on PR, we should convert QuorumTestHarness to the new mechanism and remove the futures-based mechanism.

Additionally, this PR adds some methods to BootstrapMetadata to make it more convenient to create new BootstrapMetadata objects. The idea is to avoid the need to mess with FeatureRecords directly, and make it easy to set whatever features are desired when using TestKit to create a cluster.

cmccabe avatar Aug 23 '24 22:08 cmccabe

@cmccabe could you please fix build error?

chia7712 avatar Aug 25 '24 09:08 chia7712

I reworked this a bit so that we can test removing voters now.

The checkstyle issue should be fixed.

cmccabe avatar Aug 27 '24 00:08 cmccabe

@cmccabe thanks for this patch.

In a follow-on PR, we should convert QuorumTestHarness to the new mechanism and remove the futures-based mechanism. Pardon me, have you opened the jira?

Thanks for the reminder. I filed it as https://issues.apache.org/jira/browse/KAFKA-17440

cmccabe avatar Aug 28 '24 21:08 cmccabe

@cmccabe could you please fix conflicts?

chia7712 avatar Aug 29 '24 15:08 chia7712

Fixed conflicts.

cmccabe avatar Aug 29 '24 20:08 cmccabe

@cmccabe Could you please fix build error?

chia7712 avatar Sep 08 '24 18:09 chia7712

I merged in trunk. I will take another look at test failures when this build completes. I expect they will boil down to adding more "this test requires this feature enabled" kind of thing.

cmccabe avatar Oct 01 '24 23:10 cmccabe

@cmccabe sorry that my #17318 causes a bunch of conflicts to this PR. Could you please fix the conflicts?

chia7712 avatar Oct 03 '24 17:10 chia7712

@chia7712 I'm continuing Colin's work in this PR: https://github.com/apache/kafka/pull/17582. Can you take a look when you get the chance? Thanks!

kevin-wu24 avatar Oct 24 '24 16:10 kevin-wu24

We added this test in https://github.com/apache/kafka/pull/17582 instead. Closing this PR

cmccabe avatar Nov 05 '24 20:11 cmccabe