MINOR: add ReconfigurableQuorumIntegrationTest
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 could you please fix build error?
I reworked this a bit so that we can test removing voters now.
The checkstyle issue should be fixed.
@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 could you please fix conflicts?
Fixed conflicts.
@cmccabe Could you please fix build error?
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 sorry that my #17318 causes a bunch of conflicts to this PR. Could you please fix the conflicts?
@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!
We added this test in https://github.com/apache/kafka/pull/17582 instead. Closing this PR