Skip to content

[fix][client] Enable TableView compacted reads for short topic names - #26626

Merged
lhotari merged 2 commits into
apache:masterfrom
lhotari:lh-fix-tableview-short-topic
Sep 17, 2026
Merged

lhotari merged 2 commits into
apache:masterfrom
lhotari:lh-fix-tableview-short-topic

Conversation

@lhotari

@lhotari lhotari commented Sep 17, 2026 •

Copy link
Copy Markdown
Member

Fixes #26625

Motivation

TableView accepts short persistent topic names such as tenant/ns/topicname and topicname, but checks the raw name for a persistent prefix. These names therefore disable compacted reads and allow creation to complete before the initial replay finishes.

Modifications

Resolve the topic with TopicName.get() and compare its domain with TopicDomain.persistent. Add a parameterized regression test covering both short forms, an explicit persistent name, a short name beginning with persistent, and an explicit non-persistent name. The test checks compacted-reader configuration and whether creation waits for the initial replay. Configure the existing builder test reader mock to return an empty last-message list for this replay path.

Verifying this change

The new regression test fails on unpatched code because readCompacted(true) is not called for a short persistent name.

  • ./gradlew :pulsar-client-original:test --tests '*TableView*Test' -PtestRetryCount=0 — all 21 cases pass.

  • ./gradlew spotlessCheck checkstyleMain checkstyleTest — passes.

  • Make sure that the change passes the CI checks.

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

  • 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

Resolve the topic domain before configuring compacted reads and initial replay.

Assisted-by: OpenAI Codex
Return an empty last-message list from the reader mock now that short names correctly use the persistent replay path.

Assisted-by: OpenAI Codex
@lhotari lhotari added this to the 5.0.0 milestone Sep 17, 2026
@lhotari
lhotari merged commit 6c8fc01 into apache:master Sep 17, 2026
82 of 84 checks passed
lhotari added a commit that referenced this pull request Sep 23, 2026
lhotari added a commit that referenced this pull request Sep 23, 2026
Radiancebobo pushed a commit to Radiancebobo/pulsar that referenced this pull request Oct 8, 2026
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.

[Bug] TableView disables compacted reads for short persistent topic names

2 participants