Skip to content

[improve][test]Add test: test/testTopicPartitionCannotBeCreatedAfterTopicDeleted#26038

Merged
merlimat merged 2 commits into
apache:masterfrom
poorbarcode:test/testTopicPartitionCannotBeCreatedAfterTopicDeleted
Jun 18, 2026
Merged

[improve][test]Add test: test/testTopicPartitionCannotBeCreatedAfterTopicDeleted#26038
merlimat merged 2 commits into
apache:masterfrom
poorbarcode:test/testTopicPartitionCannotBeCreatedAfterTopicDeleted

Conversation

@poorbarcode

Copy link
Copy Markdown
Contributor

Motivation

#24118 added a check that prevents partition creation if there is no partitioned topic metadata.

Modifications

Adds a new test to cover more cases: producer reconnects will not create up the partition once a partitioned topic was deleted.

  • Create a partitioned topic
  • Create a producer which is connected to the newly created topic.
  • A broken network occurs
  • Since the connection was closed, the broker has no producer registered anymore
    • The partitioned topic can be deleted before the producer reconnects.
  • The producer tries to reconnect.
    • Verify: the reconnection will get an error because the partitioned topic has been deleted

Does this pull request potentially affect one of the following parts:

If the box was checked, please highlight the changes

  • Dependencies (add or upgrade a dependency)
  • The public API
  • The schema
  • The default values of configurations
  • The threading model
  • The binary protocol
  • The REST endpoints
  • The admin CLI options
  • The metrics
  • Anything that affects deployment

@poorbarcode poorbarcode added this to the 5.0.0-M1 milestone Jun 16, 2026
@poorbarcode poorbarcode self-assigned this Jun 16, 2026
@merlimat
merlimat merged commit 8eaf551 into apache:master Jun 18, 2026
42 checks passed
lhotari pushed a commit that referenced this pull request Jun 22, 2026
lhotari pushed a commit that referenced this pull request Jun 22, 2026
@lhotari

lhotari commented Jun 29, 2026

Copy link
Copy Markdown
Member

#24118 is missing from branch-4.0, so I'll revert this test from branch-4.0.

lhotari added a commit that referenced this pull request Jun 29, 2026
…edAfterTopicDeleted (#26038)"

This reverts commit 85ee3b9.

The test testTopicPartitionCannotBeCreatedAfterTopicDeleted (added by #26038)
is a regression test for the topic consistency check introduced on master by
#24118 ("[fix][broker] Add topic consistency check"). That broker-side check
(NamespaceService/BrokerService) prevents a partition from being re-created /
loaded once its partitioned-topic metadata has been deleted, which is what the
test asserts via assertFalse(producer.isConnected()).

On branch-4.0, #24118 was deliberately reverted (eef20ed) and its master
replacement PIP-414 (#24213) was never backported, so the consistency-check
behavior the test relies on is absent. Without it, a reconnecting producer can
race the topic deletion and re-create the partition, so the producer stays
connected and the test fails ("expected [false] but found [true]",
SimpleProducerConsumerTest.java:5465).

#26038 is a test-only PR that should not have been cherry-picked to branch-4.0
without its prerequisite production fix. Reverting the test restores a green
build; the underlying feature remains intentionally absent on this branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants