Skip to content
2 changes: 1 addition & 1 deletion local-antora-playbook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ content:
- url: https://github.com/redpanda-data/docs
branches: [v/*, shared, site-search,'!v-end-of-life/*']
- url: https://github.com/redpanda-data/cloud-docs
branches: 'main'
branches: 'DOC-1939-Add-Schema-Validation-topic-in-general-and-cluster-property-enable_schema_id_validation-to-cloud-docs'
- url: https://github.com/redpanda-data/redpanda-labs
branches: main
start_paths: [docs,'*/docs']
Expand Down
46 changes: 37 additions & 9 deletions modules/manage/pages/schema-reg/schema-id-validation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ To use schema ID validation:

ifndef::env-cloud[]
By default, server-side schema ID validation is disabled in Redpanda. To enable schema ID validation, change the xref:reference:cluster-properties.adoc#enable_schema_id_validation[`enable_schema_id_validation`] cluster property from its default value of `none` to either `redpanda` or `compat`:
endif::[]

ifdef::env-cloud[]
By default, server-side schema ID validation is disabled in Redpanda. To enable schema ID validation, change the xref:reference:properties/cluster-properties.adoc#enable_schema_id_validation[`enable_schema_id_validation`] cluster property from its default value of `none` to either `redpanda` or `compat`:
endif::[]

* `none`: Schema validation is disabled (no schema ID checks are done). Associated topic properties cannot be modified.
* `redpanda`: Schema validation is enabled. Only Redpanda topic properties are accepted.
* `compat`: Schema validation is enabled. Both Redpanda and compatible topic properties are accepted.

ifndef::env-cloud[]
For example, use `rpk` to set the value of `enable_schema_id_validation` to `redpanda` through the Admin API:

[,bash]
Expand All @@ -51,13 +57,7 @@ rpk cluster config set enable_schema_id_validation redpanda -X admin.hosts=<admi
endif::[]

ifdef::env-cloud[]
To enable schema ID validation, set the `enable_schema_id_validation` cluster property to either `redpanda` or `compat`:

* `none`: Schema validation is disabled (no schema ID checks are done). Associated topic properties cannot be modified.
* `redpanda`: Schema validation is enabled. Only Redpanda topic properties are accepted.
* `compat`: Schema validation is enabled. Both Redpanda and compatible topic properties are accepted.

See xref:manage:cluster-maintenance/config-cluster.adoc[]
See xref:manage:cluster-maintenance/config-cluster.adoc[].
endif::[]

=== Set subject name strategy per topic
Expand Down Expand Up @@ -87,6 +87,7 @@ When <<enable-schema-id-validation,schema ID validation is enabled>>, Redpanda u

To customize the subject name strategy per topic, set the following client topic properties:

ifndef::env-cloud[]
* Set xref:reference:properties/topic-properties.adoc#redpandakeyschemavalidation[`redpanda.key.schema.id.validation`] to `true` to enable key schema ID validation for the topic, and set xref:reference:properties/topic-properties.adoc#redpandakeysubjectnamestrategy[`redpanda.key.subject.name.strategy`] to the desired subject name strategy for keys of the topic (default: `TopicNameStrategy`).
* Set xref:reference:properties/topic-properties.adoc#redpandavalueschemavalidation[`redpanda.value.schema.id.validation`] to `true` to enable value schema ID validation for the topic, and set xref:reference:properties/topic-properties.adoc#redpandavaluesubjectnamestrategy[`redpanda.value.subject.name.strategy`] to the desired subject name strategy for values of the topic (default: `TopicNameStrategy`).

Expand All @@ -109,11 +110,38 @@ The `redpanda.` properties have corresponding `confluent.` properties.
| xref:reference:properties/topic-properties.adoc#redpandavaluesubjectnamestrategy[`redpanda.value.subject.name.strategy`]
| xref:reference:properties/topic-properties.adoc#confluentvaluesubjectnamestrategy[`confluent.value.subject.name.strategy`]
|===
====
endif::[]

ifdef::env-cloud[]
* Set `redpanda.key.schema.id.validation` to `true` to enable key schema ID validation for the topic, and set `redpanda.key.subject.name.strategy` to the desired subject name strategy for keys of the topic (default: `TopicNameStrategy`).
* Set `redpanda.value.schema.id.validation` to `true` to enable value schema ID validation for the topic, and set `redpanda.value.subject.name.strategy` to the desired subject name strategy for values of the topic (default: `TopicNameStrategy`).

[NOTE]
====
The `redpanda.` properties have corresponding `confluent.` properties.

|===
| Redpanda property | Confluent property

| `redpanda.key.schema.id.validation`
| `confluent.key.schema.validation`

| `redpanda.key.subject.name.strategy`
| `confluent.key.subject.name.strategy`

| `redpanda.value.schema.id.validation`
| `confluent.value.schema.validation`

| `redpanda.value.subject.name.strategy`
| `confluent.value.subject.name.strategy`
|===
====
endif::[]

The `redpanda.*` and `confluent.*` properties are compatible. Either or both can be set simultaneously.

If `subject.name.strategy` is prefixed with `confluent.`, the available subject name strategies must be prefixed with `io.confluent.kafka.serializers.subject.`. For example, `io.confluent.kafka.serializers.subject.TopicNameStrategy`.
====

NOTE: To support schema ID validation for compressed topics, a Redpanda broker decompresses each batch written to it so it can access the schema ID.

Expand All @@ -139,4 +167,4 @@ rpk topic alter-config topic_foo \
-X brokers=<broker-addr>:9092
----

// end::single-source[]
// end::single-source[]
1 change: 1 addition & 0 deletions modules/reference/pages/glossary.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Terms are organized into the following categories:

- <<Agentic Data Plane>>
- <<Redpanda Cloud>>
- <<Redpanda core>>
- <<Redpanda features>>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5011,10 +5011,13 @@ endif::[]
|===


// tag::redpanda-cloud[]
=== enable_schema_id_validation

Controls whether Redpanda validates schema IDs in records and which topic properties are enforced.

NOTE: Enabling this property will trigger decompression of message batches for topics on which validation is configured, which may lead to a modest increase in CPU load. Redpanda recommends monitoring CPU utilization after topics are configured.

Values:

* `none`: Schema validation is disabled (no schema ID checks are done). Associated topic properties cannot be modified.
Expand Down Expand Up @@ -5070,6 +5073,7 @@ endif::[]

|===

// end::redpanda-cloud[]

// tag::redpanda-cloud[]
=== enable_shadow_linking
Expand Down