Skip to content

[UX-1513] Schema Registry: context aware schema resolution - #2653

Open
r-vasquez wants to merge 4 commits into
masterfrom
rv/sr-context-aware-schema-resolution
Open

r-vasquez wants to merge 4 commits into
masterfrom
rv/sr-context-aware-schema-resolution

Conversation

@r-vasquez

Copy link
Copy Markdown
Contributor

This PR introduces Schema Registry context-aware schema resolution + a fix for a bug.

The schema ID resolution happens in the backend in the following form:

  • An explicit context in the request (overridable in the frontend)
  • The topic's redpanda.schema.registry.context configuration field. (Used by iceberg topics)
  • Otherwise, use the Default context (.)

Deserialization options for unbounded topics
Before
image

After
image

Expanded schema name
Before
image

After
image

Bugs:
2 Schemas with the same ID (IDs are unique per context) would resolve to the default context (.) and fail deserialization:

Before
image

After
image

Search for Schema ID (2 of them)

Before (only default was shown)
image

After
image

@github-actions

github-actions Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow Buf CI / validate (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedSep 16, 2026, 3:44 AM

@github-actions

Copy link
Copy Markdown
Contributor

Clean — no registry drift, off-token colours, or ad-hoc classes

App: frontend · Scope: diff vs origin/master · Files: 20

Count
⚠️ Outdated registry components 0
🛠 Locally-modified components 0
❓ Unknown to registry 0
🎨 Off-token palette colours 0
🔢 Ad-hoc utility classes 0

Generated by lookout audit-changes.

@r-vasquez r-vasquez changed the title Rv/sr context aware schema resolution Schema Registry: context aware schema resolution Sep 16, 2026
@r-vasquez
r-vasquez force-pushed the rv/sr-context-aware-schema-resolution branch from 59defa7 to f0caa50 Compare September 16, 2026 03:35
@r-vasquez r-vasquez changed the title Schema Registry: context aware schema resolution [UX-1513] Schema Registry: context aware schema resolution Sep 16, 2026
PublishMessagePayloadOptions and
GenerateSchemaSampleRequest carry the Schema
Registry context a schema_id belongs to. Schema
IDs are only unique within a context, so the ID
is resolved there instead of in the default
context. Empty keeps today's behaviour: the
topic's redpanda.schema.registry.context is used
when set, otherwise the default context.
Console fetched schemas by ID in the default
Schema Registry context only, and cached them by
ID. Schema IDs are unique per context, so records
of a topic bound to a context via
redpanda.schema.registry.context failed to decode
or, when the default context had the same ID,
were decoded with the wrong schema without any
error. Producing and the Protobuf message types
on subject pages went wrong the same way.

Schema lookups now carry the context: the message
viewer and produce path read it from the topic
config once per request, subject pages take it
from the qualified subject name, and clients can
name it explicitly. Cache keys include the
context. Searching usages by schema ID covers
every context. A failed config lookup logs a
warning and falls back to the default context.
The message detail's Schema row showed the first
subject using a schema ID, which is a subject of
the default context even when the topic is bound
to another context and the same ID names a
different schema there. It now prefers the
subject in the topic's context, read from the
topic's redpanda.schema.registry.context config.

The produce form sends the context of the picked
subject along with the schema ID, so the backend
encodes with that exact schema. The form offers
no schema encodings today, so this only takes
effect once they return.
ListMessagesRequest carries a schema_context that
names the Schema Registry context to resolve the
records' schema IDs in. It takes precedence over
the topic's redpanda.schema.registry.context, and
"." forces the default context. This covers topics
that hold records from a named context without
being bound to one.

The choice is offered next to the key and value
deserializers, only when the registry has
contexts, and is kept in the URL (sc) and per
topic like the deserializers.
@r-vasquez
r-vasquez force-pushed the rv/sr-context-aware-schema-resolution branch from f0caa50 to 6ec6a3b Compare September 16, 2026 03:44
@r-vasquez
r-vasquez enabled auto-merge September 16, 2026 22:28
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.

1 participant