Skip to content

[Broker] Fix read schema compatibility strategy priority - #13938

Merged
codelipenghui merged 1 commit into
apache:masterfrom
nodece:fix_schema_compatibility_strategy
Jan 26, 2022
Merged

[Broker] Fix read schema compatibility strategy priority#13938
codelipenghui merged 1 commit into
apache:masterfrom
nodece:fix_schema_compatibility_strategy

Conversation

@nodece

@nodece nodece commented Jan 25, 2022

Copy link
Copy Markdown
Member

Signed-off-by: Zixuan Liu nodeces@gmail.com

Motivation

When we defined the schemaCompatibilityStrategy=ALWAYS_INCOMPATIBLE in broker.conf, and a namespace policies so like:

schema_auto_update_compatibility_strategy = SchemaAutoUpdateCompatibilityStrategy.Full
schema_compatibility_strategy = null

We should get SchemaCompatibilityStrategy.FULL by pulsar-admin namespaces get-schema-compatibility-strategy <ns>, but got SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE, this is incorrect response.

Modifications

  • Use null as Policies#schema_auto_update_compatibility_strategy value
  • Use FULL as schemaCompatibilityStrategy value in broker.conf and update configuration code
  • Only return Policies#schema_compatibility_strategy when get schema compatibility strategy of namespace
  • Change the read schema compatibility strategy priority

Verifying this change

  • Make sure that the change passes the CI checks.

Documentation

@codelipenghui codelipenghui added this to the 2.10.0 milestone Jan 25, 2022
@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Jan 25, 2022
@nodece

nodece commented Jan 25, 2022

Copy link
Copy Markdown
Member Author

Hi @Jason918, could you take a look this?

Comment thread pulsar-broker/src/main/java/org/apache/pulsar/broker/service/AbstractTopic.java Outdated
@nodece
nodece force-pushed the fix_schema_compatibility_strategy branch 2 times, most recently from 599c6f6 to 39e7749 Compare January 25, 2022 10:56
@nodece
nodece requested a review from codelipenghui January 25, 2022 11:01
@github-actions github-actions Bot added the doc-required Your PR changes impact docs and you will update later. label Jan 25, 2022
@nodece
nodece force-pushed the fix_schema_compatibility_strategy branch from 39e7749 to 3e76c3e Compare January 25, 2022 17:03
@nodece
nodece requested a review from codelipenghui January 25, 2022 17:03
@nodece
nodece force-pushed the fix_schema_compatibility_strategy branch 3 times, most recently from 74c508f to 67719fe Compare January 26, 2022 02:49
@nodece

nodece commented Jan 26, 2022

Copy link
Copy Markdown
Member Author

/pulsarbot rerun-failure-checks

Signed-off-by: Zixuan Liu <nodeces@gmail.com>
@nodece
nodece force-pushed the fix_schema_compatibility_strategy branch from 67719fe to 9282042 Compare January 26, 2022 04:21
@nodece
nodece requested a review from congbobo184 January 26, 2022 05:34

@congbobo184 congbobo184 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codelipenghui
codelipenghui merged commit c18d645 into apache:master Jan 26, 2022
codelipenghui pushed a commit that referenced this pull request Jan 27, 2022
Signed-off-by: Zixuan Liu <nodeces@gmail.com>

When we defined the `schemaCompatibilityStrategy=ALWAYS_INCOMPATIBLE` in `broker.conf`, and a namespace policies so like:
```
schema_auto_update_compatibility_strategy = SchemaAutoUpdateCompatibilityStrategy.Full
schema_compatibility_strategy = null
```
We should get `SchemaCompatibilityStrategy.FULL` by `pulsar-admin namespaces get-schema-compatibility-strategy <ns>`, but got `SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE`, this is incorrect response.

- Use `null` as `Policies#schema_auto_update_compatibility_strategy` value
- Use `FULL` as `schemaCompatibilityStrategy` value in `broker.conf` and update configuration code
- Only return `Policies#schema_compatibility_strategy` when get schema compatibility strategy of namespace
- Change the read schema compatibility strategy priority

(cherry picked from commit c18d645)
@codelipenghui codelipenghui added cherry-picked/branch-2.8 Archived: 2.8 is end of life and removed cherry-picked/branch-2.8 Archived: 2.8 is end of life labels Jan 27, 2022
codelipenghui pushed a commit that referenced this pull request Jan 29, 2022
Signed-off-by: Zixuan Liu <nodeces@gmail.com>

### Motivation

When we defined the `schemaCompatibilityStrategy=ALWAYS_INCOMPATIBLE` in `broker.conf`, and a namespace policies so like:
```
schema_auto_update_compatibility_strategy = SchemaAutoUpdateCompatibilityStrategy.Full
schema_compatibility_strategy = null
```
We should get `SchemaCompatibilityStrategy.FULL` by `pulsar-admin namespaces get-schema-compatibility-strategy <ns>`, but got `SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE`, this is incorrect response.

### Modifications

- Use `null` as `Policies#schema_auto_update_compatibility_strategy` value
- Use `FULL` as `schemaCompatibilityStrategy` value in `broker.conf` and update configuration code
- Only return `Policies#schema_compatibility_strategy` when get schema compatibility strategy of namespace
- Change the read schema compatibility strategy priority

(cherry picked from commit c18d645)
@codelipenghui codelipenghui added the cherry-picked/branch-2.9 Archived: 2.9 is end of life label Jan 29, 2022
zymap pushed a commit that referenced this pull request Jan 30, 2022
Signed-off-by: Zixuan Liu <nodeces@gmail.com>

When we defined the `schemaCompatibilityStrategy=ALWAYS_INCOMPATIBLE` in `broker.conf`, and a namespace policies so like:
```
schema_auto_update_compatibility_strategy = SchemaAutoUpdateCompatibilityStrategy.Full
schema_compatibility_strategy = null
```
We should get `SchemaCompatibilityStrategy.FULL` by `pulsar-admin namespaces get-schema-compatibility-strategy <ns>`, but got `SchemaCompatibilityStrategy.ALWAYS_INCOMPATIBLE`, this is incorrect response.

- Use `null` as `Policies#schema_auto_update_compatibility_strategy` value
- Use `FULL` as `schemaCompatibilityStrategy` value in `broker.conf` and update configuration code
- Only return `Policies#schema_compatibility_strategy` when get schema compatibility strategy of namespace
- Change the read schema compatibility strategy priority

(cherry picked from commit c18d645)
@zymap zymap added the cherry-picked/branch-2.8 Archived: 2.8 is end of life label Jan 30, 2022
@Anonymitaet

Anonymitaet commented Feb 7, 2022

Copy link
Copy Markdown
Member

@nodece are the docs added in #13983? If yes, can you link the code and the corresponding doc PR in the future? (so that others can see the changes clearly, thanks).

@nodece

nodece commented Feb 7, 2022

Copy link
Copy Markdown
Member Author

@Anonymitaet Done, thanks.

@Anonymitaet Anonymitaet added doc-complete Your PR changes impact docs and the related docs have been already added. and removed doc-required Your PR changes impact docs and you will update later. labels Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker cherry-picked/branch-2.8 Archived: 2.8 is end of life cherry-picked/branch-2.9 Archived: 2.9 is end of life doc-complete Your PR changes impact docs and the related docs have been already added. doc-not-needed Your PR changes do not impact docs release/2.8.3 release/2.9.2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants