You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "void-ptr974 (via GitHub)" <gi...@apache.org> on 2026/09/24 16:07:49 UTC
[PR] [fix][broker] Prevent BookkeeperSchemaStorage and BookkeeperBucketSnapshotStorage from bypassing namespace bookie affinity [pulsar]
void-ptr974 opened a new pull request, #26703:
URL: https://github.com/apache/pulsar/pull/26703
### Motivation
When a namespace has a bookie affinity group, or strict bookie affinity selects the isolated placement policy, managed-ledger data uses the matching placement-aware BookKeeper client. `BookkeeperSchemaStorage` and `BookkeeperBucketSnapshotStorage` instead created their auxiliary ledgers with their independently configured default clients and did not persist the selected placement policy in ledger metadata.
As a result, newly created schema and delayed-delivery bucket ledgers could be placed outside the namespace's configured bookie groups. Bookie replacement for those ledgers also lacked the placement metadata needed to preserve the same policy.
### Modifications
- Resolve the schema or delayed-bucket owner topic before creating a ledger.
- Borrow the placement-aware BookKeeper client introduced by #26702 and add the matching standard placement-policy metadata to the ledger.
- Recognize canonical schema storage keys, including encoded local names and scalable topic names.
- Preserve the existing default-client behavior for arbitrary and legacy schema storage keys that do not identify an unambiguous owner topic.
- Keep placement failures strict: do not silently fall back to the default client.
- Preserve delayed-bucket retry behavior by exposing policy lookup and client creation failures as `BucketSnapshotPersistenceException`.
### Impact
- Only newly created schema and delayed-delivery bucket ledgers are affected; existing ledgers and their read/delete paths are unchanged.
- Namespaces without a custom or strict placement policy continue to use the shared default BookKeeper client and do not receive placement metadata.
- Placement clients are cached by policy configuration and borrowed from managed-ledger storage; this does not create one BookKeeper client per topic.
- Canonical three-part schema keys inherit the owner namespace policy. Arbitrary and legacy keys continue to use the schema storage's existing default client.
### Stack
Depends on #26702. This branch contains the dependency commit; the commit specific to this PR is `a7b2ccb439f`.
### Tests
- `./gradlew :pulsar-broker:test --no-build-cache --tests org.apache.pulsar.broker.service.schema.BookkeeperSchemaStorageTest --tests org.apache.pulsar.broker.service.schema.SchemaServiceTest --tests org.apache.pulsar.broker.delayed.BookkeeperBucketSnapshotStorageTest --tests org.apache.pulsar.broker.delayed.bucket.BookkeeperBucketSnapshotStoragePlacementTest`
- `./gradlew :pulsar-broker:checkstyleMain :pulsar-broker:checkstyleTest`
--
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
Re: [PR] [fix][broker] Prevent BookkeeperSchemaStorage and BookkeeperBucketSnapshotStorage from bypassing namespace bookie affinity [pulsar]
Posted by "void-ptr974 (via GitHub)" <gi...@apache.org>.
void-ptr974 commented on PR #26703:
URL: https://github.com/apache/pulsar/pull/26703#issuecomment-5818195748
Closing in favor of #26705. The schema and delayed-delivery bucket change remains the second of the three commits in that unified PR, whose description now documents the complete problem, implementation, and impact.
--
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
Re: [PR] [fix][broker] Prevent BookkeeperSchemaStorage and BookkeeperBucketSnapshotStorage from bypassing namespace bookie affinity [pulsar]
Posted by "void-ptr974 (via GitHub)" <gi...@apache.org>.
void-ptr974 closed pull request #26703: [fix][broker] Prevent BookkeeperSchemaStorage and BookkeeperBucketSnapshotStorage from bypassing namespace bookie affinity
URL: https://github.com/apache/pulsar/pull/26703
--
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