KAFKA-20627: Add broker integration tests for topology description plugin#22775
Open
aliehsaeedii wants to merge 8 commits into
Open
KAFKA-20627: Add broker integration tests for topology description plugin#22775aliehsaeedii wants to merge 8 commits into
aliehsaeedii wants to merge 8 commits into
Conversation
…ugin Add integration test coverage for the streams group topology description plugin (KIP-1331): - StreamsGroupTopologyDescriptionRequestTest: broker-level RPC tests with the InMemoryTopologyDescriptionPlugin configured, covering heartbeat solicitation, the push-describe lifecycle, validation errors (INVALID_REQUEST / GROUP_ID_NOT_FOUND / UNKNOWN_MEMBER_ID / stale epoch), and DeleteGroups with a stored description. - StreamsGroupTopologyDescriptionNoPluginRequestTest: UNSUPPORTED_VERSION for the push RPC, no heartbeat solicitation, and NOT_STORED on describe when no plugin is configured. - TopologyDescriptionPluginIntegrationTest: end-to-end push lifecycle with real KafkaStreams clients — push after join, two-member dedup (exactly one setTopology call), permanent plugin failure stops re-solicitation, and DeleteGroups invokes plugin.deleteTopology. - TopologyDescriptionPluginExpirationIntegrationTest: natural group expiry — the cleanup cycle calls deleteTopology and clears the stored epoch before the group is tombstoned; a group whose push permanently failed is tombstoned without any deleteTopology call. - DescribeStreamsGroupTest#testDescribeStreamsGroupWithTopologyOption: kafka-streams-groups.sh --describe --topology end-to-end. - PlaintextAdminIntegrationTest#testDescribeStreamsGroupsWithTopologyDescription: Admin API includeTopologyDescription option (NOT_REQUESTED / NOT_STORED). - EmbeddedKafkaCluster now configures InMemoryTopologyDescriptionPlugin by default so all streams integration tests exercise the topology description path. - GroupCoordinatorBaseRequestTest: new streamsGroupTopologyDescriptionUpdate helper and IncludeTopologyDescription support on streamsGroupDescribe. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The 2s observation window is shorter than the 30s initial re-solicitation back-off, so the assertion cannot distinguish the permanent-failure ratchet from an armed back-off; note that the classification is covered at the unit level so a future reader does not over-trust it. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
A retriable send failure (e.g. a disconnect after the broker already processed the push) makes the client retry, which would produce a second setTopology call at the same epoch and fail the exactly-one assertion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…stone Folding every ExecutionException into 'group not yet deleted' masked real failures such as admin timeouts; waitForCondition retries a throwing condition and rethrows the last exception at timeout, so rethrowing keeps the retry behavior while preserving the diagnostics. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…msGroupTest testDescribeStreamsGroupWithTopologyOption silently depended on EmbeddedKafkaCluster's default plugin from another module's test util; a change to that default would have failed the test as an opaque timeout. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n opt-out - pin offsets.retention.check.interval.ms very high in TopologyDescriptionPluginIntegrationTest so the explicit DeleteGroups call is the only delete path; a slow run crossing the default 10-minute interval could otherwise expire the empty, offset-less group first - expose EmbeddedKafkaCluster.NO_TOPOLOGY_DESCRIPTION_PLUGIN as a documented constant for opting out of the default in-memory plugin, replacing the magic empty string, and use it in TopologyDescriptionNoPluginIntegrationTest Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the integration test coverage for the streams group topology
description plugin (KIP-1331) requested in
KAFKA-20627:
Broker-level RPC tests (
core)StreamsGroupTopologyDescriptionRequestTest(plugin configuredwith
InMemoryTopologyDescriptionPlugin):TopologyDescriptionRequired, thepush → describe lifecycle returns
AVAILABLEwith the stored topology,and there is no re-solicitation once stored
INVALID_REQUEST,unknown group →
GROUP_ID_NOT_FOUND, unknown member →UNKNOWN_MEMBER_ID, stale topology epoch →INVALID_REQUESTDeleteGroupssucceeds on a group with a stored description and thegroup is gone afterwards
StreamsGroupTopologyDescriptionNoPluginRequestTest(no pluginconfigured): the push RPC returns
UNSUPPORTED_VERSION, heartbeatsnever solicit a push, and describe reports
NOT_STOREDGroupCoordinatorBaseRequestTest: newstreamsGroupTopologyDescriptionUpdatehelper andIncludeTopologyDescriptionsupport onstreamsGroupDescribeEnd-to-end tests with real
KafkaStreamsclients(
streams/integration-tests)TopologyDescriptionPluginIntegrationTest— 4 tests covering thecore push lifecycle on a live cluster:
re-solicitation (call count stays at one, the application keeps running,
describe reports
NOT_STORED)DeleteGroupstriggersplugin.deleteTopologyTopologyDescriptionPluginExpirationIntegrationTest— 2 testscovering natural group expiry:
plugin.deleteTopologyand clears the stored epoch before theexpiration sweep tombstones the group
-1): thetombstone fires directly without any
deleteTopologycallTopologyDescriptionNoPluginIntegrationTest— 1 test keeping theplugin-less production default exercised end-to-end at the streams
level: a real
KafkaStreamsclient joins and runs normally against abroker without a plugin (no push is ever solicited), and describe with
includeTopologyDescriptionreportsNOT_STOREDTrackingTopologyDescriptionPlugintest plugin (extendsInMemoryTopologyDescriptionPlugin, records per-groupsetTopology/deleteTopologycalls in static state and can injectpermanent failures) — the embedded brokers run in the test JVM
CLI and Admin API
DescribeStreamsGroupTest#testDescribeStreamsGroupWithTopologyOption:exercises
kafka-streams-groups.sh --describe --topologyend-to-end,waiting until the output contains
Topologies:and the source topicname
PlaintextAdminIntegrationTest#testDescribeStreamsGroupsWithTopologyDescription:DescribeStreamsGroupsOptions.includeTopologyDescriptionwiring(
NOT_REQUESTED/NOT_STOREDon a plugin-less cluster; theAVAILABLEpath is covered via the Admin API inTopologyDescriptionPluginIntegrationTest)Infrastructure
EmbeddedKafkaCluster.addDefaultBrokerPropsIfAbsentnow configuresInMemoryTopologyDescriptionPluginviaputIfAbsent, so all streamsintegration tests exercise the topology description path and catch
regressions without per-test changes. An explicitly empty value for
group.streams.topology.description.plugin.classopts out and runs thebroker with the plugin-less production default (a
Propertiescannotcarry null and an empty class name would fail config parsing)
streams:integration-testsgains agroup-coordinator-apitestdependency; import-control allows
org.apache.kafka.server.streamsinstreams integration tests
Testing
All 15 new tests pass locally, plus checkstyle on the touched modules.
Committer Checklist (excluded from commit message)
🤖 Generated with Claude Code