Skip to content

Commit 93e075c

Browse files
authored
[25.3] Import mode for Schema Registry (#1391)
1 parent ececa84 commit 93e075c

File tree

3 files changed

+138
-70
lines changed

3 files changed

+138
-70
lines changed

modules/get-started/pages/release-notes/redpanda.adoc

Lines changed: 4 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -7,68 +7,9 @@ This topic includes new content added in version {page-component-version}. For a
77
* xref:redpanda-cloud:get-started:whats-new-cloud.adoc[]
88
* xref:redpanda-cloud:get-started:cloud-overview.adoc#redpanda-cloud-vs-self-managed-feature-compatibility[Redpanda Cloud vs Self-Managed feature compatibility]
99
10-
== Iceberg topics with AWS Glue
10+
== Schema Registry import mode
1111

12-
A new xref:manage:iceberg/iceberg-topics-aws-glue.adoc[integration with AWS Glue Data Catalog] allows you to add Redpanda topics as Iceberg tables in your data lakehouse. The AWS Glue catalog integration is available in Redpanda version 25.1.7 and later.
12+
Redpanda Schema Registry now supports an import mode that allows you to import existing schemas and retain their current IDs and version numbers. Import mode is useful when migrating from another schema registry.
1313

14-
See xref:manage:iceberg/rest-catalog/index.adoc[] for supported Iceberg REST catalog integrations.
15-
16-
== JSON Schema support for Iceberg topics
17-
18-
Redpanda now supports JSON Schema for Iceberg topics. This allows you to use all supported schema types (Protobuf, Avro, and JSON Schema) for Iceberg topics. For more information, see xref:manage:iceberg/specify-iceberg-schema.adoc[].
19-
20-
== Manage SASL users with Kafka APIs
21-
22-
Redpanda now supports the following Kafka APIs for managing SASL user credentials as described in https://cwiki.apache.org/confluence/display/KAFKA/KIP-554%3A+Add+Broker-side+SCRAM+Config+API[KIP-554^]:
23-
24-
- DescribeUserSCRAMCredentialsRequest (requires Cluster Describe ACLs)
25-
- AlterUserSCRAMCredentialsRequest (requires Cluster Modify ACLs)
26-
27-
See also: xref:manage:security/authentication.adoc#sasl[Configure Authentication] and xref:manage:security/authorization/acl.adoc[]
28-
29-
== Schema Registry Authorization
30-
31-
You can now use the Enterprise-licensed feature xref:manage:schema-reg-authorization.adoc[Schema Registry Authorization] to control access to Schema Registry subjects and operations using either `rpk` or the link:/api/doc/schema-registry/operation/operation-get_security_acls[Redpanda Schema Registry API] endpoints. Schema Registry Authorization offers more granular control over who can do what with your Redpanda Schema Registry resources. ACLs used for Schema Registry access also support RBAC roles.
32-
33-
== Retrieve serialized Protobuf schemas with Schema Registry API
34-
35-
Starting in version 25.2, the Schema Registry API supports retrieving serialized schemas (Protobuf only) using the `format=serialized` query parameter for the following endpoints:
36-
37-
- `GET /schemas/ids/\{id}`
38-
- `POST /subjects/\{subject}`
39-
- `GET subjects/\{subject}/versions/\{version}`
40-
- `GET subjects/\{subject}/versions/\{version}/schema`
41-
42-
This helps facilitate migration of Protobuf clients to Redpanda. See the link:/api/doc/schema-registry[Schema Registry API reference] for details.
43-
44-
== Support for confluent-kafka-javascript client
45-
46-
The `confluent-kafka-javascript` client is now validated with Redpanda. For a list of validated clients, see xref:develop:kafka-clients.adoc[].
47-
48-
== HTTP Proxy authentication changes
49-
50-
include::shared:partial$http-proxy-ephemeral-credentials-breaking-change.adoc[tags=!*;include-config-link]
51-
52-
If you need to maintain the current HTTP Proxy functionality while transitioning to authenticated clients, configure the following HTTP Proxy client properties in your `redpanda.yaml` configuration:
53-
54-
- xref:reference:properties/broker-properties.adoc#scram_username[`scram_username`]: Username for SASL/SCRAM authentication
55-
- xref:reference:properties/broker-properties.adoc#scram_password[`scram_password`]: Password for SASL/SCRAM authentication
56-
- xref:reference:properties/broker-properties.adoc#sasl_mechanism[`sasl_mechanism`]: SASL mechanism (typically `SCRAM-SHA-256` or `SCRAM-SHA-512`)
57-
58-
== New topic properties
59-
60-
- xref:reference:properties/topic-properties.adoc#max.compaction.lag.ms[`max.compaction.lag.ms`]
61-
- xref:reference:properties/topic-properties.adoc#min.compaction.lag.ms[`min.compaction.lag.ms`]
62-
63-
== New cluster properties
64-
65-
- xref:reference:properties/cluster-properties.adoc#audit_failure_policy[`audit_failure_policy`]
66-
- xref:reference:properties/cluster-properties.adoc#iceberg_rest_catalog_base_location[`iceberg_rest_catalog_base_location`]
67-
- xref:reference:properties/cluster-properties.adoc#kafka_topics_max[`kafka_topics_max`]
68-
- xref:reference:properties/cluster-properties.adoc#log_compaction_merge_max_ranges[`log_compaction_merge_max_ranges`]
69-
- xref:reference:properties/cluster-properties.adoc#log_compaction_merge_max_segments_per_range[`log_compaction_merge_max_segments_per_range`]
70-
- xref:reference:properties/cluster-properties.adoc#log_compaction_pause_use_sliding_window[`log_compaction_pause_use_sliding_window`]
71-
- xref:reference:properties/cluster-properties.adoc#max_compaction_lag_ms[`max_compaction_lag_ms`]
72-
- xref:reference:properties/cluster-properties.adoc#min_compaction_lag_ms[`min_compaction_lag_ms`]
73-
- xref:reference:properties/cluster-properties.adoc#schema_registry_enable_authorization[`schema_registry_enable_authorization`]
74-
- xref:reference:properties/cluster-properties.adoc#topic_label_aggregation_limit[`topic_label_aggregation_limit`]
14+
Starting with this release, import mode must be used when importing schemas. Read-write mode no longer allows specifying a schema ID and version when registering a schema.
15+
See xref:manage:schema-reg/schema-reg-api.adoc#set-schema-registry-mode[Use the Schema Registry API] for more information.

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

Lines changed: 132 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -976,52 +976,177 @@ Curl::
976976
--
977977
====
978978

979-
== Use READONLY mode for disaster recovery
979+
== Set Schema Registry mode
980980

981-
The `/mode` endpoint allows you to put Schema Registry in read-only or read-write mode. A read-only Schema Registry does not accept direct writes. An active production cluster can replicate schemas to a read-only Schema Registry to keep it in sync, for example using Redpanda's https://github.com/redpanda-data/schema-migration/[Schema Migration tool^]. Users in the disaster recovery (DR) site cannot update schemas directly, so the DR cluster has an exact replica of the schemas in production. In a failover due to a disaster or outage, you can set Schema Registry to read-write mode, taking over for the failed cluster and ensuring availability.
981+
The `/mode` endpoint allows you to put Schema Registry in read-only, read-write, or import mode.
982+
983+
* In read-write mode (the default), you can both register and look up schemas.
984+
* In <<use-readonly-mode-for-disaster-recovery,read-only mode>>, you can only look up schemas. This mode is most useful for standby clusters in a disaster recovery setup.
985+
* In <<use-import-mode-for-migration,import mode>>, you can only register schemas. This mode is most useful for target clusters in a migration setup.
982986

983987
If authentication is enabled on Schema Registry, only superusers can change global and subject-level modes.
984988

989+
[CAUTION]
990+
====
991+
*Breaking change in Redpanda 25.3:* In Redpanda versions before 25.3, you could specify a schema ID or version when registering a schema in read-write mode.
992+
993+
Starting with 25.3, read-write mode returns an error when you try to register a schema with a specific ID or version. If you have custom scripts that rely on the ability to specify an ID or version with Redpanda 25.2 and earlier, you must do either of the following:
994+
995+
* Omit the ID and version fields when registering a schema. The schema will be registered under a new ID and version.
996+
* Change the Schema Registry or the subject to import mode.
997+
====
998+
985999
=== Get global mode
9861000

9871001
To link:/api/doc/schema-registry/operation/operation-get_mode[query the global mode] for Schema Registry:
9881002

1003+
[tabs]
1004+
====
1005+
rpk::
1006+
+
1007+
--
1008+
```bash
1009+
rpk registry mode get --global
1010+
```
1011+
--
1012+
1013+
Curl::
1014+
+
9891015
```bash
9901016
curl http://localhost:8081/mode
9911017
```
1018+
====
9921019

9931020
=== Set global mode
9941021

1022+
Set the mode for Schema Registry at a global level. This mode applies to all subjects that do not have a specific mode set.
1023+
1024+
[tabs]
1025+
====
1026+
rpk::
1027+
+
1028+
--
1029+
```bash
1030+
rpk registry mode set --mode <mode> --global
1031+
```
1032+
--
1033+
1034+
Curl::
1035+
+
9951036
```bash
9961037
curl -X PUT -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"mode": <mode>}' http://localhost:8081/mode
9971038
```
1039+
====
9981040

9991041
Replace the `<mode>` placeholder with the desired mode:
10001042

10011043
- `READONLY`
10021044
- `READWRITE`
1045+
- `IMPORT`
10031046

10041047
=== Get mode for a subject
10051048

1006-
This request returns an error if there is no specific mode set for the subject:
1049+
To look up the mode for a specific subject:
10071050

1051+
[tabs]
1052+
====
1053+
rpk::
1054+
+
1055+
--
10081056
```bash
1009-
curl http://localhost:8081/mode/<subject>
1057+
rpk registry mode get <subject-name>
10101058
```
1059+
--
10111060
1012-
To retrieve the mode regardless of whether or not the subject has a specific mode, use the `defaultToGlobal` parameter:
1013-
1061+
Curl::
1062+
+
10141063
```bash
10151064
curl http://localhost:8081/mode/<subject>?defaultToGlobal=true
10161065
```
1066+
====
1067+
1068+
This request returns the mode that is enforced. If the subject is set to a specific mode (to override the global mode), it returns the override mode. Otherwise, it returns the global mode.
1069+
1070+
To retrieve the subject-level override if it exists, use:
1071+
1072+
```bash
1073+
curl http://localhost:8081/mode/<subject>
1074+
```
10171075

1018-
This request returns the mode that is enforced. If the subject is set to a specific mode (to override the global mode), it will return the override mode, otherwise it returns the global mode.
1076+
This request returns an error if there is no specific mode set for the subject.
10191077

10201078
=== Set mode for a subject
10211079

1080+
[tabs]
1081+
====
1082+
rpk::
1083+
+
1084+
--
1085+
```bash
1086+
rpk registry mode set <subject-name> --mode READONLY
1087+
```
1088+
--
1089+
1090+
Curl::
1091+
+
10221092
```bash
10231093
curl -X PUT -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"mode": "READONLY"}' http://localhost:8081/mode/<subject>
10241094
```
1095+
====
1096+
1097+
=== Use READONLY mode for disaster recovery
1098+
1099+
A read-only Schema Registry does not accept direct writes. An active production cluster can replicate schemas to a read-only Schema Registry to keep it in sync, for example using Redpanda's https://github.com/redpanda-data/schema-migration/[Schema Migration tool^]. Users in the disaster recovery (DR) site cannot update schemas directly, so the DR cluster has an exact replica of the schemas in production. In a failover due to a disaster or outage, you can set Schema Registry to read-write mode, taking over for the failed cluster and ensuring availability.
1100+
1101+
=== Use IMPORT mode for migration
1102+
1103+
Set the target Schema Registry to import mode to:
1104+
1105+
- Bypass compatibility checks when registering schemas.
1106+
- Specify a specific schema ID and version for the registered schema, so you can retain the same IDs and version from the original Schema Registry and keep topic data associated with the correct schema.
1107+
1108+
To enable import mode, you must have:
1109+
1110+
* Either superuser access, or a Schema Registry ACL with the `alter_configs` operation on the `registry` resource. See xref:manage:schema-reg/schema-reg-authorization.adoc#enable-schema-registry-authorization[Enable Schema Registry Authorization] to learn how to enable schema registry authorization for your cluster.
1111+
* An empty registry or subject. That is, either no schemas have ever been registered, or you must <<hard-delete-a-schema,hard-delete>> all schemas that were registered.
1112+
+
1113+
To bypass the check for an empty registry when setting the global mode to import:
1114+
+
1115+
[tabs]
1116+
====
1117+
rpk::
1118+
+
1119+
--
1120+
```bash
1121+
rpk registry mode set --mode IMPORT --global --force
1122+
```
1123+
--
1124+
1125+
Curl::
1126+
+
1127+
```bash
1128+
curl -X PUT -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"mode": "IMPORT"}' http://localhost:8081/mode?force=true
1129+
```
1130+
====
1131+
1132+
Use import mode to register a schema with a specific ID and version:
1133+
1134+
[tabs]
1135+
====
1136+
rpk::
1137+
+
1138+
--
1139+
```bash
1140+
rpk registry schema create <subject-name> --schema order.proto --id 1 --schema-version 4
1141+
```
1142+
--
1143+
1144+
Curl::
1145+
+
1146+
```bash
1147+
curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"schema": "syntax = \"proto3\";\nmessage Order {\n string id = 1;\n}", "schemaType": "PROTOBUF", "id": 1, "version": 4}' http://localhost:8081/subjects/<subject-name>/versions
1148+
```
1149+
====
10251150

10261151
== Retrieve serialized schemas
10271152

modules/upgrade/partials/incompat-changes.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
=== Review incompatible changes
22

3+
* *Breaking change in Redpanda 25.3*: Schema Registry no longer allows specifying a schema ID and version when registering a schema in read-write mode. You must use import mode to register a schema with a specific ID and version. See xref:manage:schema-reg/schema-reg-api.adoc#set-schema-registry-mode[Use the Schema Registry API] for more information.
4+
35
* {empty}
46
+
57
--

0 commit comments

Comments
 (0)