Skip to content

Conversation

@dajac
Copy link
Member

@dajac dajac commented Jan 16, 2026

This patch adds tests to validate that duplicate full heartbeat requests
are handled idempotently in all member states (STABLE,
UNREVOKED_PARTITIONS, UNRELEASED_PARTITIONS).

Reviewers: Dongnuo Lyu dlyu@confluent.io, Lianet Magrans
lmagrans@confluent.io

dajac added 2 commits January 16, 2026 10:05
This adds tests to validate that duplicate full heartbeat requests are
handled idempotently in all member states (STABLE, UNREVOKED_PARTITIONS,
UNRELEASED_PARTITIONS). Each test verifies that the duplicate produces
the same response with no records generated.
@dajac dajac requested a review from lianetm January 16, 2026 09:47
@github-actions github-actions bot added core Kafka Broker tests Test fixes (including flaky tests) group-coordinator labels Jan 16, 2026

assertEquals(MemberState.STABLE, context.consumerGroupMemberState(groupId, memberId));

// Duplicate heartbeat with same request but epoch is now stale.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The comment is a bit misleading. Would it be better to say Duplicate heartbeat with same request but with the new epoch.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree is confusing, but actually if the intention is to testDuplicateFullHeartbeatWithRevocationAck I guess the comment is right but the epoch 101 is wrong (should be 100).

Shouldn't we just remove the duplicateRequest and send the same fullRequest from above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed it.

Copy link
Member

@lianetm lianetm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Just one comment


assertEquals(MemberState.STABLE, context.consumerGroupMemberState(groupId, memberId));

// Duplicate heartbeat with same request but epoch is now stale.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree is confusing, but actually if the intention is to testDuplicateFullHeartbeatWithRevocationAck I guess the comment is right but the epoch 101 is wrong (should be 100).

Shouldn't we just remove the duplicateRequest and send the same fullRequest from above?

@dajac dajac requested review from dongnuo123 and lianetm January 16, 2026 20:42
Copy link
Member

@lianetm lianetm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

@mjsax mjsax changed the title KAFKA-19233; Add tests for duplicate heartbeat request handling KAFKA-19233: Add tests for duplicate heartbeat request handling Jan 16, 2026
@dajac dajac merged commit 0e1e68d into apache:trunk Jan 17, 2026
25 checks passed
@dajac dajac deleted the kip-848-duplicate-reqs branch January 17, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Kafka Broker group-coordinator tests Test fixes (including flaky tests)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants