Skip to content

Commit 2f9d3df

Browse files
authored
Apply suggestions from code review
Co-authored-by: Joyce Fee <102751339+Feediver1@users.noreply.github.com>
1 parent fbeee42 commit 2f9d3df

1 file changed

Lines changed: 32 additions & 29 deletions

File tree

modules/manage/pages/schema-reg/schema-reg-contexts.adoc

Lines changed: 32 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
:page-tags: [Schema Registry, contexts, multi-tenant, Confluent compatibility]
44
Learning objectives:
55
:learning-objective-1: Understand what Schema Registry contexts are and when to use them.
6-
:learning-objective-2: Understand the qualified subject syntax (:<context>:<subject>).
6+
:learning-objective-2: Understand the qualified subject syntax (`:<context>:<subject>`).
77
:learning-objective-3: Enable the feature using the cluster configuration property (requires broker restart), and configuring contexts, including per-context mode and compatibility settings.
88
:learning-objective-4: Apply ACLs to control access at the context level.
99
:learning-objective-5: Identify updated metrics and the new cluster configuration property.
@@ -22,7 +22,6 @@ After reading this page, you will be able to:
2222
* [ ] {learning-objective-4}
2323
* [ ] {learning-objective-5}
2424
* [ ] {learning-objective-6}
25-
* [ ]
2625
2726
Schema Registry contexts are namespaces that isolate schemas, subjects, and configurations from one another within a single Schema Registry instance.
2827
Each context maintains its own schema ID counter, mode settings, and compatibility settings.
@@ -69,12 +68,13 @@ The `schema_registry_enable_qualified_subjects` property defaults to `false`, so
6968

7069

7170
== How Schema Registry contexts work
71+
When you enable contexts, Schema Registry changes how it assigns schema IDs, resolves configuration, and interprets subject names.
7272

7373
=== Schema ID isolation
7474

75-
Before contexts, the Schema Registry maintained a single global ID counter. All schemas shared one ID space, and a given schema ID pointed to exactly one schema across the entire registry.
75+
Prior to v26.1, the Schema Registry maintained a single global ID counter. All schemas shared one ID space, and a given schema ID pointed to exactly one schema across the entire registry.
7676

77-
After enabling contexts, each context has its own independent ID counter. This means schema ID `1` in `.staging` and schema ID `1` in `.production` are different schemas. As a result (and by default), `GET /schemas/ids/{id}` searches the _default context only_. To retrieve a schema by ID from a non-default context, you must pass the `subject` query parameter to scope the lookup:
77+
With Schema Registry contexts, each context has its own independent ID counter. This means schema ID `1` in `.staging` and schema ID `1` in `.production` are different schemas. As a result (and by default), `GET /schemas/ids/{id}` searches the _default context only_. To retrieve a schema by ID from a non-default context, you must pass the `subject` query parameter to scope the lookup:
7878

7979
[source,bash]
8080
----
@@ -85,7 +85,7 @@ See also <<schema-id-lookup-fails>>.
8585

8686
=== Configuration resolution order
8787

88-
Before contexts, mode and compatibility settings resolved as:
88+
Prior to v26.1, mode and compatibility settings resolved as:
8989

9090
----
9191
Subject → Global → Built-in defaults
@@ -128,7 +128,7 @@ Wherever the Schema Registry API accepts a subject, you can supply a qualified s
128128

129129
=== `GET /subjects` behavior change
130130

131-
After enabling the flag, `GET /subjects` (with no `subjectPrefix`) returns subjects across *all* contexts. Non-default context subjects appear with their qualified names for example, `:.staging:my-topic`. This is a behavioral change from the previous flat list of bare subject names.
131+
After enabling the flag, `GET /subjects` (with no `subjectPrefix`) returns subjects across _all_ contexts. Non-default context subjects appear with their qualified names (for example, `:.staging:my-topic`). Note that this is differs from the previous flat lists of bare subject names.
132132

133133
=== Cross-context schema references
134134

@@ -137,7 +137,7 @@ Contexts do not enforce isolation of schema references. Schemas can reference sc
137137
== Enable Schema Registry contexts
138138

139139
ifndef::env-cloud[]
140-
To enable contexts on a self-managed cluster, set the `schema_registry_enable_qualified_subjects` cluster configuration property to `true`:
140+
To enable contexts, set the `schema_registry_enable_qualified_subjects` cluster configuration property to `true`:
141141

142142
[source,bash]
143143
----
@@ -165,6 +165,7 @@ endif::env-cloud[]
165165

166166
=== Register a schema in a context
167167

168+
The following configuration examples show how to perform common context operations using the Schema Registry HTTP API and qualified subject syntax.
168169
To register a schema in a named context, use the qualified subject form in the `POST /subjects/{subject}/versions` request:
169170

170171
[source,bash]
@@ -341,7 +342,7 @@ Unqualified references in schema definitions resolve to the same context as the
341342

342343
=== Delete a context
343344

344-
A context can only be deleted when it contains no subjects. Soft-deleted subjects still count you must hard-delete all subjects before the context can be removed. Attempting to delete a non-empty context returns a `context_not_empty` error.
345+
You can only delete a context when it contains no subjects. Soft-deleted subjects still count; however, you must hard-delete all subjects before removing the context. Attempting to delete a non-empty context returns a `context_not_empty` error.
345346

346347
[NOTE]
347348
====
@@ -358,11 +359,11 @@ curl -s -X DELETE http://localhost:8081/contexts/.staging
358359
----
359360

360361

361-
== rpk commands
362+
== Configure Schema Registry contexts using rpk
362363

363364
[NOTE]
364365
====
365-
Native `rpk` commands for context management operations (listing, creating, and deleting contexts) are not yet available. Use the Schema Registry HTTP API directly for context-level operations. See <<client-integration-status>>.
366+
Native `rpk` commands for context management operations (listing, creating, and deleting contexts) are not available. Use the Schema Registry HTTP API for context-level operations. See <<client-integration-status>>.
366367
====
367368

368369
Existing `rpk registry` commands that accept a subject name support qualified subject syntax once `schema_registry_enable_qualified_subjects` is enabled. Pass a qualified subject wherever a `--subject` flag is accepted:
@@ -422,7 +423,7 @@ rpk security acl create \
422423
--allow-principal User:alice
423424
----
424425

425-
For full reference documentation on these commands, see:
426+
For additional detail, refer to the full reference documentation for these commands:
426427

427428
* xref:reference:rpk/rpk-registry/rpk-registry-schema-create.adoc[]
428429
* xref:reference:rpk/rpk-registry/rpk-registry-schema-list.adoc[]
@@ -437,42 +438,43 @@ For full reference documentation on these commands, see:
437438

438439
== Client integration status
439440

441+
The following table identifies the support level of Schema Registry context client integrations.
440442
[#client-integration-status]
441443

442444
[cols="2,1,3", options="header"]
443445
|===
444446
| Client | Status | Notes
445447

446448
| Schema Registry API (all operations)
447-
| Full support
449+
| Supported
448450
| Use qualified subjects directly in any endpoint.
449451

450452
| Java SerDe (Confluent)
451453
| Supported
452454
| Requires a custom `ContextNameStrategy`. See the Confluent SerDe documentation for details.
453455

454456
| Non-Java SerDe
455-
| Not yet supported (26.1)
456-
| Planned in a 26.1.x patch release. Workaround: set the client's Schema Registry base URL to `http://<host>:8081/contexts/{context}`.
457+
| Not supported
458+
| Workaround: set the client's Schema Registry base URL to `http://<host>:8081/contexts/{context}`.
457459

458460
| rpk
459-
| In progress
460-
| Context management commands not yet available. Qualified subjects work in existing `rpk registry` commands.
461+
| Not supported
462+
| Context management commands not available. Qualified subjects work in existing `rpk registry` commands.
461463

462464
| Redpanda Console
463-
| In progress
464-
| Not available in 26.1.
465+
| Not supported
466+
|
465467

466468
| Server-side schema ID validation
467469
| Not supported
468-
| Out of scope for this release.
470+
|
469471
|===
470472

471473
== ACL authorization
472474

473475
[#acl-authorization]
474476

475-
Contexts use the existing `sr_subject` and `sr_registry` ACL resource types. No new resource types are needed.
477+
Contexts use the existing `sr_subject` and `sr_registry` ACL resource types.
476478

477479
[cols="2,2,2", options="header"]
478480
|===
@@ -519,7 +521,7 @@ rpk security acl create \
519521

520522
=== Audit log format
521523

522-
When Schema Registry ACLs are enabled, audit log entries include the fully qualified subject name for non-default context operations:
524+
When you enable Schema Registry ACLs, audit log entries include the fully qualified subject name for non-default context operations:
523525

524526
[source,json]
525527
----
@@ -533,11 +535,11 @@ When Schema Registry ACLs are enabled, audit log entries include the fully quali
533535
}
534536
----
535537

536-
Default context subjects are logged with their unqualified name (no change from existing behavior).
538+
Default context subjects are logged with their unqualified name.
537539

538540
== Metrics
539541

540-
The following Schema Registry metrics have been updated to include a `context` label, enabling per-context monitoring:
542+
The following Schema Registry metrics include a `context` label, enabling per-context monitoring:
541543

542544
[cols="2,2", options="header"]
543545
|===
@@ -565,12 +567,12 @@ endif::env-cloud[]
565567

566568
[IMPORTANT]
567569
====
568-
*Breaking change*: When `schema_registry_enable_qualified_subjects` is enabled, any existing subject whose name matches the qualified subject pattern for example, `:.staging:user-value` is reinterpreted as subject `user-value` in context `.staging`, rather than as a literal subject name in the default context. Subjects without a `:.` prefix are unaffected.
570+
*Breaking change*: When `schema_registry_enable_qualified_subjects` is enabled, any existing subject whose name matches the qualified subject pattern (for example, `:.staging:user-value`) is reinterpreted as subject `user-value` in context `.staging`, rather than as a literal subject name in the default context. Subjects without a `:.` prefix are unaffected.
569571
570-
This edge case is expected to be rare. No automatic migration is provided.
572+
This edge case is rare. No automatic migration is provided.
571573
====
572574

573-
To audit your existing subjects for affected names before enabling the feature:
575+
To audit your existing subjects for affected names before enabling Schema Registry contexts:
574576

575577
ifndef::env-cloud[]
576578
[source,bash]
@@ -586,7 +588,7 @@ curl -s http://<schema-registry-host>:8081/subjects | jq '.[] | select(startswit
586588
----
587589
endif::env-cloud[]
588590

589-
If affected subjects are found, rename them before enabling the property, or plan to re-register them under the reinterpreted context structure after enabling.
591+
If you find affected subjects, rename them before enabling the property, or plan to re-register them under the reinterpreted context structure after enabling.
590592

591593

592594
[IMPORTANT]
@@ -596,6 +598,7 @@ Remember that changing `schema_registry_enable_qualified_subjects` requires a br
596598

597599
== Troubleshooting
598600

601+
Following is troubleshooting guidance for Schema Registry contexts.
599602
[#schema-id-lookup-fails]
600603
=== Schema ID lookup returns 404 or wrong schema
601604

@@ -614,7 +617,7 @@ curl -s "http://localhost:8081/schemas/ids/1?subject=:.staging:my-topic"
614617

615618
*Symptom*: Subjects with the `:.` prefix are stored as literal subject names in the default context instead of being parsed as context-qualified subjects.
616619

617-
*Cause 1*: `schema_registry_enable_qualified_subjects` is set to `false` (the 26.1 default for self-managed clusters).
620+
*Cause 1*: `schema_registry_enable_qualified_subjects` is set to `false` (the default).
618621

619622
*Cause 2*: The property was set to `true` but the brokers have not yet been restarted. This property is not dynamic and requires a full broker restart to take effect.
620623

@@ -628,7 +631,7 @@ rpk cluster config set schema_registry_enable_qualified_subjects true
628631
----
629632
endif::env-cloud[]
630633

631-
=== Schema registration fails after upgrading to 26.1
634+
=== Schema registration fails after upgrading to v26.1
632635

633636
*Symptom*: A `POST /subjects/{subject}/versions` request returns an unexpected error after upgrading and enabling the flag.
634637

0 commit comments

Comments
 (0)