Skip to content

[improve][broker] PIP-473: group all txn metadata paths under /txn/#25792

Merged
lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/pip-473-path-cleanup
May 19, 2026
Merged

[improve][broker] PIP-473: group all txn metadata paths under /txn/#25792
lhotari merged 1 commit into
apache:masterfrom
merlimat:mmerli/pip-473-path-cleanup

Conversation

@merlimat
Copy link
Copy Markdown
Contributor

Summary

P2.5 — path-prefix cleanup for PIP-473 metadata. Moves the four transaction-metadata prefixes shipped in P2 (#25754) and used by P3 / P4 (#25768, #25772) under a single /txn/ root, grouped by purpose:

Before After
/txn/<txnId> /txn/id/<txnId>
/txn-op/... /txn/op/...
/txn-segment-events/... /txn/segment-events/...
/txn-subscription-events/... /txn/subscription-events/...

Headers move to /txn/id/<txnId> so getChildren("/txn") returns the four purpose-buckets cleanly, not a mix of txnIds and sibling prefixes. The new /txn/ root also leaves room for upcoming P3.5 additions like /txn/segment-state/<segment>/... (per the visibility-state design note) without further restructuring.

No behaviour change. The new TC and TB/PendingAckStore providers all remain disabled by default — same path layout is used by exactly the same code, just under different names.

Test plan

  • All path construction already goes through TxnPaths helpers, so the rename is contained to the constants in TxnPaths.java plus the corresponding javadoc/comment text in the records and the participant code. Audit for hardcoded paths in pulsar-broker/src/main and pulsar-broker/src/test came up clean.
  • pulsar-broker:test --tests TxnMetadataStoreTest — 7 cases pass.
  • pulsar-broker:test --tests MetadataTransactionBufferTest — 7 cases pass.
  • pulsar-broker:test --tests MetadataPendingAckStoreTest — 6 cases pass.
  • pulsar-broker:test --tests DispatchingTransactionBufferProviderTest — 2 cases pass.
  • pulsar-broker:test --tests DispatchingTransactionPendingAckStoreProviderTest — 2 cases pass.
  • pulsar-broker:test --tests TxnIdsTest — 7 cases pass.
  • Checkstyle clean on pulsar-broker.

P2.5 — path-prefix cleanup. Moves the four transaction metadata prefixes
shipped in P2 (and used by P3 + P4) under a single /txn/ root, grouped by
purpose:

  /txn/<txnId>             →  /txn/id/<txnId>
  /txn-op/...              →  /txn/op/...
  /txn-segment-events/...  →  /txn/segment-events/...
  /txn-subscription-events/... → /txn/subscription-events/...

Headers move to /txn/id/<txnId> so getChildren("/txn") returns the four
purpose-buckets cleanly, not a mix of txnIds and sibling prefixes.

No behaviour change. All path construction already goes through TxnPaths
helpers, so the rename is contained to the constants in TxnPaths.java plus
the corresponding javadoc/comment text in the records and the participant
code. P2/P3/P4 unit tests all pass unchanged.

The new /txn/ root also makes room for upcoming P3.5 additions like
/txn/segment-state/<segment>/... per the visibility-state design note,
without further restructuring.
@merlimat merlimat requested a review from lhotari May 15, 2026 20:38
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

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

LGTM

@lhotari lhotari merged commit dd938e3 into apache:master May 19, 2026
81 of 83 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants