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

[I] [Bug] Acknowledged Scalable Topic delete resurrects in Oxia as a permanently unreadable ghost key (getMetadata 500, survives broker restart) [pulsar]

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

   ### Search before reporting
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) and found nothing similar.
   
   
   ### Read release policy
   
   - [x] I understand that [unsupported versions](https://pulsar.apache.org/contribute/release-policy/#supported-versions) don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
   
   
   ### User environment
   
   - Broker: Apache Pulsar **5.0.0** with Scalable Topics (`scalableTopicsEnabled=true`)
   - Metadata store: **Oxia** (`metadataStoreUrl=oxia://…/broker`), `pulsar-oxia-server` StatefulSet (multi-server, quorum)
   - Kubernetes (AWS EKS, eu-central-1), single broker
   - Admin client: `pulsar-client-admin` 5.0.0 (our REST gateway) and `pulsar-admin` from `pulsar-toolset`
   - Related but distinct: #26846 (same reporter) covers the *in-memory* controller residue on ZooKeeper where `getMetadata` correctly returns 404 and a broker restart clears the listing. **This issue is different and strictly worse: the Oxia key itself reappears after the delete converged, `getMetadata` returns 500, and nothing — including broker restart — clears it.** Also related: #26066 (PIP-468, auto-recreation of deleted scalable topics by namespace consumers) — this resurrection happens on a plain create/stats/delete loop with no namespace consumers attached.
   
   
   ### Issue Description
   
   A Scalable Topic delete that the broker acknowledged (`200`/`204`) — and whose absence was **confirmed** by polling `getMetadata` until `404` — can later **resurrect in Oxia as a permanently unreadable "ghost" key**. The resurrected key:
   
   - is returned by `listScalableTopics` (the topic reappears in listings, minutes after the delete converged),
   - makes `getMetadata` fail with `500` — server-side `ContentDeserializationException`, `No content to map due to end-of-input` (the stored value is empty/truncated),
   - still answers `getStats` with `200` from the stale in-memory controller (`subscriptions: {}`),
   - **never heals**: it survives broker restarts and is only removable by deleting the key directly in Oxia.
   
   Observed at a base rate of **0.7% of plain delete cycles with no fault injected**, and **6% (12/200) when an Oxia leader kill is applied during the loop**. In the leader-kill run the resurrection is unambiguous: the convergence poll observed `getMetadata` → `404` *before* the key came back.
   
   ### Reproduction instructions
   
   Harness (Python, `pulsar-client-admin` via REST): per cycle `i` —
   
   1. `POST /admin/v3/scalable-topics/{tenant}/{ns}/t{i}` (create, 1 initial segment)
   2. `GET  /admin/v3/scalable-topics/{tenant}/{ns}/t{i}/stats`
   3. `DELETE /admin/v3/scalable-topics/{tenant}/{ns}/t{i}` → expect 2xx
   4. poll `GET /admin/v3/scalable-topics/{tenant}/{ns}/t{i}/metadata` every 500 ms until `404` (delete convergence; budget 6 s)
   
   **Scenario A — no fault injected:** 1000 sequential cycles in one namespace.
   Result: 1000/1000 cycles ok, 0 stats failures. After the run, `listScalableTopics` still returns 7 of the deleted topics (0.7%):
   
   ```
   topic://WEBHOOK-GATE/fi-1009b-s7/s7-125   (also: s7-383, s7-604, s7-761, s7-903, s7-956, s7-982)
   ```
   
   **Scenario B — Oxia leader kill:** same loop, 200 cycles, `kubectl delete pod` on the Oxia leader around cycle 40 (leader re-election mid-run).
   Result: 198 deletes converged; 2 failed the convergence check (broker kept reporting `not empty`, surfaced as retryable 502 by our gateway); **12 topics whose deletes had already converged (`getMetadata` → 404 observed) later reappeared in Oxia** (`g40`–`g51` in our run).
   
   **Ghost three-state signature** (live-probed against the broker, hours later, after a broker restart):
   
   ```
   GET  /admin/v3/scalable-topics/WEBHOOK-GATE/fi-213509-ghost
        -> ["topic://WEBHOOK-GATE/fi-213509-ghost/g40"]          # listed
   
   GET  .../g40/metadata
        -> 500 {"reason":"Failed to deserialize payload for key
           '/topics/WEBHOOK-GATE/fi-213509-ghost/g40' ...
           No content to map due to end-of-input"}               # ContentDeserializationException
   
   GET  .../g40/stats
        -> 200, subscriptions={}                                 # stale in-memory controller
   ```
   
   `oxia client get -n broker /topics/WEBHOOK-GATE/fi-213509-ghost/g40` shows the key exists with an empty/unparsable value.
   
   ### Observed behavior
   
   - Deleted topics reappear in Oxia **after** the delete had converged.
   - The resurrected value is empty/truncated (`No content to map due to end-of-input`), so every metadata read 500s.
   - The ghost is permanent: broker restart does not remove it (unlike #26846); the only removal is `oxia client delete -n broker /topics/<tenant>/<ns>/<name>`.
   - Secondary effect: any client that filters `listScalableTopics` through `getMetadata` (the only way to prove existence) gets a 500 for the whole namespace — a single ghost makes the namespace listing unusable for correctness-minded consumers.
   
   ### Expected behavior
   
   - A delete acknowledged with `200`/`204` is final: the metadata key never reappears afterwards, regardless of Oxia leader failover.
   - If a half-applied key can exist, reads should surface a well-defined error (e.g. `404`/`410`, or a specific error code) rather than a deserialization failure that poisons whole-namespace listings.
   
   ### Additional information
   
   - The resurrection happens *after* the deleting session observed `404`, which points at a replayed/half-applied write landing post-convergence rather than client-visible reordering. Question: is there a fencing/epoch guarantee between Oxia sessions and broker metadata writes across leader failover? The base-rate 0.7% without any injected fault suggests the same mechanism fires during ordinary leader activity (or background Oxia traffic).
   - The stored value being empty (`No content to map due to end-of-input`) is consistent with a partially applied write (key created, value truncated/empty).
   - We worked around the operational side: our drift sweep treats listed-but-unreadable topics as present and reports them as unmanaged resources, and we purge ghosts manually via the Oxia CLI. But the broker should not produce permanent garbage.
   - Happy to provide broker/Oxia logs, the raw Python harness, and the full per-cycle timing data (create/stats/delete latencies + convergence timestamps for all 1200 cycles) if useful.
   


-- 
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