-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Issue 5562][docs]Modify schema compatibility check doc #5757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
sijie
merged 18 commits into
apache:master
from
congbobo184:modify_schema_compatibility_check_doc
Dec 3, 2019
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cdf7735
no message
congbobo 145f97e
Revert "no message"
congbobo f27d415
Merge remote-tracking branch 'apache/master'
congbobo dc85737
Merge remote-tracking branch 'apache/master'
congbobo 65e6f83
Merge remote-tracking branch 'apache/master'
congbobo 260b137
Merge remote-tracking branch 'apache/master'
congbobo a97e048
Add
congbobo 8206ddd
Modify the undifine
congbobo b5a74d0
Modify the undifine
congbobo ed9d4e4
modify the undifine
congbobo 0ad08a0
Modify the undifine
congbobo 1626326
modify the style
congbobo 2bacf2d
fix some comments
congbobo bd8cf19
Fix some comments
congbobo 2918c0d
Fix some comments
congbobo 86751e8
recover the image
congbobo 4573502
fix some comments
congbobo d5dce05
Fix some comments
congbobo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -539,14 +539,26 @@ This diagram illustrates how does schema work on the Producer side. | |
| 3. The broker looks up the schema in the schema storage to check if it is already a registered schema. | ||
|
|
||
| 4. If yes, the broker skips the schema validation since it is a known schema, and returns the schema version to the producer. | ||
|
|
||
| 5. If no, the broker verifies whether a schema can be automatically created in this namespace: | ||
|
|
||
| * If `isAllowAutoUpdateSchema` sets to **true**, then a schema can be created, and the broker validates the schema based on the schema compatibility check strategy defined for the topic. | ||
|
|
||
| 5. If no, the broker validates the schema based on the schema compatibility check strategy defined for the topic. | ||
| * If `isAllowAutoUpdateSchema` sets to **false**, then a schema can not be created, and the producer is rejected to connect to the broker. | ||
|
|
||
| 6. If the schema is compatible, the broker stores it and returns the schema version to the producer. | ||
| **Tip**: | ||
|
|
||
| `isAllowAutoUpdateSchema` can be set via **Pulsar admin API** or **REST API.** | ||
|
|
||
| For how to set `isAllowAutoUpdateSchema` via Pulsar admin API, see [Manage AutoUpdate Strategy](schema-manage.md/#manage-autoupdate-strategy). | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| 6. If the schema is allowed to be updated, then the compatible strategy check is performed. | ||
|
|
||
| * If the schema is compatible, the broker stores it and returns the schema version to the producer. | ||
|
|
||
| All the messages produced by this producer are tagged with the schema version. | ||
|
|
||
| 7. If the schema is incompatible, the broker rejects it. | ||
| * If the schema is incompatible, the broker rejects it. | ||
|
|
||
| ### Consumer side | ||
|
|
||
|
|
@@ -559,17 +571,21 @@ This diagram illustrates how does Schema work on the consumer side. | |
| The schema instance defines the schema that the consumer uses for decoding messages received from a broker. | ||
|
|
||
| 2. The consumer connects to the broker with the `SchemaInfo` extracted from the passed-in schema instance. | ||
|
|
||
| 3. The broker looks up the schema in the schema storage to check if it is already a registered schema. | ||
|
|
||
| 4. If yes, the broker skips the schema validation since it is a known schema, and returns the schema version to the consumer. | ||
|
|
||
| 5. If no, the broker validates the schema based on the schema compatibility check strategy defined for the topic. | ||
|
|
||
| 6. If the schema is compatible, the broker stores it and returns the schema version to the consumer. | ||
|
|
||
| 7. If the schema is incompatible, the consumer will be disconnected. | ||
| 3. The broker determines whether the topic has one of them (a schema/data/a local consumer and a local producer). | ||
|
|
||
| 4. If a topic does not have all of them (a schema/data/a local consumer and a local producer): | ||
|
|
||
| * If `isAllowAutoUpdateSchema` sets to **true**, then the consumer registers a schema and it is connected to a broker. | ||
|
|
||
| * If `isAllowAutoUpdateSchema` sets to **false**, then the consumer is rejected to connect to a broker. | ||
|
|
||
| 5. If a topic has one of them (a schema/data/a local consumer and a local producer), then the schema compatibility check is performed. | ||
|
|
||
| * If the schema passes the compatibility check, then the consumer is connected to the broker. | ||
|
|
||
| * If the schema does not pass the compatibility check, then the consumer is rejected to connect to the broker. | ||
|
|
||
| 8. The consumer receives the messages from the broker. | ||
| 6. The consumer receives messages from the broker. | ||
|
|
||
| If the schema used by the consumer supports schema versioning (for example, AVRO schema), the consumer fetches the `SchemaInfo` of the version tagged in messages, and use the passed-in schema and the schema tagged in messages to decode the messages. | ||
| If the schema used by the consumer supports schema versioning (for example, AVRO schema), the consumer fetches the `SchemaInfo` of the version tagged in messages and uses the passed-in schema and the schema tagged in messages to decode the messages. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As we discussed just now, please correct the commands for
enableanddisable