You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2026/09/17 07:05:03 UTC

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

lhotari opened a new issue, #26625:
URL: https://github.com/apache/pulsar/issues/26625

   ### User environment
   
   Java client on current `master` (218736587e6). Reproduced with a deterministic client unit test; no broker is needed to observe the incorrect reader configuration.
   
   ### Issue Description
   
   `TableViewImpl` determines whether a topic is persistent with:
   
   ```java
   conf.getTopicName().startsWith(TopicDomain.persistent.toString())
   ```
   
   The Java client accepts `tenant/ns/topicname` and `topicname` as persistent topic names. `TopicName.get()` resolves them to `persistent://tenant/ns/topicname` and `persistent://public/default/topicname`, respectively. However, `TableViewBuilderImpl.topic()` only trims the supplied string, so TableView classifies these valid names as non-persistent (unless the string happens to begin with `persistent`).
   
   As a result, the underlying reader does not enable compacted reads. TableView creation also skips waiting for the initial replay, so creation can complete before existing messages populate the table.
   
   ### Reproducing the issue
   
   1. Create a Java TableView with `.topic("tenant/ns/topicname")` or `.topic("topicname")`.
   2. Observe that the reader builder is never configured with `readCompacted(true)` and creation does not wait for the initial replay.
   3. Use the equivalent fully qualified `persistent://` name: compacted reads and initial replay waiting are enabled.
   
   A deterministic regression test using a mocked reader builder fails on unpatched master at `verify(builder).readCompacted(true)` for a short name.
   
   ### Expected behavior
   
   Equivalent short and fully qualified persistent topic names should enable compacted reads and wait for the initial replay. Explicit non-persistent topics should retain their existing behavior.
   
   ### Proposed fix
   
   Parse the name with `TopicName.get(conf.getTopicName())` and compare its domain with `TopicDomain.persistent`.
   
   ### Are you willing to submit a PR?
   
   - [x] I'm willing to submit a PR!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] TableView disables compacted reads for short persistent topic names [pulsar]

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari closed issue #26625: [Bug] TableView disables compacted reads for short persistent topic names
URL: https://github.com/apache/pulsar/issues/26625


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org