merlimat opened a new pull request, #25637:
URL: https://github.com/apache/pulsar/pull/25637
## Summary
Schemas on a scalable topic are scoped at the parent topic, not per-segment:
`TopicName.getSchemaName()` returns `tenant/ns/encodedLocalName`, and the
segment-domain parser sets `localName = parent` (descriptor is held in
separate
`segmentRange` / `segmentId` fields), so every segment of the same scalable
topic shares one schema id — `t/ns/parent`. The schema registry therefore
holds
a single version history per scalable topic, and split / merge children
inherit
it transparently.
This PR adds tests pinning that contract.
## Tests (`V5SchemaEvolutionTest`)
- **`testSingleSchemaIdAcrossSegments`** — produce v1 on a single-segment
topic,
split into two children, produce v1 again across them.
`admin.schemas().getAllSchemas` returns exactly one entry. If schemas were
per-segment we'd see one entry per segment.
- **`testCompatibleSchemaUpgradeAcrossSplit`** — produce v1, split, produce a
BACKWARD-compatible v2 across the new children. The compatibility check
sees
the pre-split v1 history and accepts v2; the registry ends up with both
versions; the consumer reads every message (v1 records decode with `j ==
null`,
v2 with `j` set).
- **`testIncompatibleSchemaAfterSplitFails`** — same setup but the post-split
producer attempts a schema with a required-not-nullable extra field
(BACKWARD-incompatible). The send is rejected, proving the broker still
consults the pre-split history.
### Matching PR(s) in forked repositories
- area/test
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]