Anonymitaet commented on a change in pull request #4845: [Doc] Add *Manage Schema* Section URL: https://github.com/apache/pulsar/pull/4845#discussion_r308776436
########## File path: site2/docs/schema-manage.md ########## @@ -0,0 +1,499 @@ +--- +id: schema-manage +title: Manage schema +sidebar_label: Manage schema +--- + +## Schema AutoUpdate + +If a schema passes the schema compatibility check, Pulsar producer automatically updates this schema to the topic it produces by default. + +### AutoUpdate for producer + +For a producer, the `AutoUpdate` happens in the following cases: + +* If a **topic doesn’t have a schema**, Pulsar registers a schema automatically. + +* If a **topic has a schema**: + + * If a **producer doesn’t carry a schema**: + + * If `isSchemaValidationEnforced` or `schemaValidationEnforced` is **disabled** in the namespace to which the topic belongs, the producer is allowed to connect to the topic and produce data. + + * If `isSchemaValidationEnforced` or `schemaValidationEnforced` is **enabled** in the namespace to which the topic belongs, the producer is rejected and disconnected. + + * If a **producer carries a schema**: + + A broker performs the compatibility check based on the configured compatibility check strategy of the namespace to which the topic belongs. + + * If it is a new schema and it passes the compatibility check, the broker registers a new schema automatically for the topic. + + * If the schema does not pass the compatibility check, the broker does not register a schema. + + + +### AutoUpdate for consumer + +For a consumer, the `AutoUpdate` happens in the following cases: + +* If a **consumer connects to a topic without a schema** (which means the consumer receiving raw bytes), the consumer can connect to the topic successfully without doing any compatibility check. + +* If a **consumer connects to a topic with a schema**: + + * If the **topic is idle** (no producers, no entries, no other consumers and no registered schemas), the broker registers the schema for the topic automatically. + + * If the **topic is not idle**, the broker verifies if the schema provided by the consumer is compatible with the registered schema of the topic. + + * If the **schema passes the compatibility check**, the consumer can connect to the topic and receive messages. + + * If the **schema does not pass the compatibility check**, the consumer is rejected and disconnected. Review comment: @sijie Is this sentence accurate? ---------------------------------------------------------------- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services