GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||
GeezerVison is showing github.com — [improve][broker] PIP-246: Improved PROTOBUF_NATIVE schema compatibility checks without using avro-protobuf by Denovo1998 · Pull Request #19566 · apache/pulsar Conversation
|
|
The pr had no activity for 30 days, mark with Stale label. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
# Conflicts: # pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/ProtobufNativeSchemaUtils.java
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the continued work on this — the rule engine is careful, and it is mostly right on protobuf semantics: fields matched by number, directional required, the oneof rule including proto3 optional, open/closed enums including the proto2 default-reordering case, packed/unpacked in both directions, and fail-closed handling of unknown editions and features. Keeping the default checker untouched and failing fast when two PROTOBUF_NATIVE checkers are configured are both good.
Two things need resolving before this can merge: the comparison has no work bound and runs synchronously on the registry path (inline on ProtobufNativeSchemaCompatibility.java), and enabling the checker can refuse consumers that reconnect with an unchanged schema under the transitive strategies.
Separately, the description only links to #26695 and leaves the template placeholders. Please summarise the change there, including that the ProtobufNativeSchemaUtils.deserialize() changes reach every native-schema user — the default checker, the upload validator and the client's generic readers — not only those who opt in. Those parts (cycle detection, nested-root resolution without a package, Java feature parsing) could arguably be a separate [fix] PR. The @FieldContext doc of schemaRegistryCompatibilityCheckers (ServiceConfiguration.java:3861) should also get the activation note you added to broker.conf.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Every point from my last review is handled, and the new work budget and version diagnostics read correctly. The PR description and the schemaRegistryCompatibilityCheckers doc now carry the activation notes I asked for.
Two non-blocking test ideas: a case where the cap is hit during the support-graph scan, and a shared writer enum paired with two different reader enums where only the second pair is incompatible. The PIP-246 vote (#26695) still needs to finish before this merges.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough rework. The opt-in checker matches PIP-246 as voted, and I didn't find defects in the new comparison logic: the strategy-to-direction mapping, per-entry reuse of identical pairs, version attribution (including KEY_VALUE components), pair memoization and the startup fail-fast all check out. The focused tests pass locally on protobuf 4.35.1 / JDK 21 (ProtobufNativeSchemaCompatibilityTest, …ReadTest, …ConfigurationTest, KeyValueSchemaCompatibilityCheckTest, SchemaServiceTest, ProtobufNativeSchemaUtilsTest, ProtobufNativeSchemaTest), and the branch merges cleanly with current master.
The main item is merge order. The copy of ProtobufNativeSchemaUtils in this PR predates the review fixes in #26725, and it changes which message some stored root aliases resolve to, for default-checker users too (see the inline comment). I'd hold this PR until #26725 lands and this branch takes its final version and tests. The other inline comments are low severity or nits.
Not inline:
doc-not-needed label doesn't seem to fit, since the PIP's General Notes say operator docs belong in pulsar-site. In the template, "The schema" (shared deserializer) and arguably "Anything that affects deployment" also apply, because startup now fails for any configured checker class that can't be loaded.ServerCnx with the advanced checker configured.KEY_VALUE encoding is covered. SEPARATED shares the decode path, so the risk is low.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Approving. 3dbd8c8 addresses everything from my previous review:
ProtobufNativeSchemaUtils and its tests, ProtobufNativeSchemaDeserializationTest, the deserialization benchmark, run_unit_group_gradle.sh and microbench/build.gradle.kts. The alias cases resolve as on master again, and either merge order is clean. If #26725 changes again before merging, please re-sync. If this PR lands first, #26725 becomes redundant.side=/detail= and work=/limit=.KEY_VALUE coverage close the test gaps I mentioned.Verified locally on 3dbd8c8 (protobuf 4.35.1, JDK 21): quickCheck, :microbench:compileJava and the focused broker/client schema tests all pass, including SchemaServiceTest with the new end-to-end test. No CI checks are reported on this head yet, so please make sure CI is green before merging.
Non-blocking:
doc-not-needed label and the unchecked "The schema" box don't match the change. The shared deserializer behaviour changes, and the PIP's General Notes say operator docs belong in pulsar-site.The two inline comments are optional wording nits.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@codelipenghui Hi, penghui. Could you help change the label from doc-not-needed to doc-required for this PR? I don’t have permission to update the labels. Thanks! |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM. I read the new commit (alias precedence in ProtobufNativeSchemaUtils, the cached extension registry, the clearer UNSUPPORTED_FEATURE and COMPARISON_LIMIT_EXCEEDED diagnostics, and the large-schema notes in the config docs). I found no problems. Legacy root aliases still resolve as before the PR, and the 14,500-field and 16,700-value figures match the work accounting.
Optional wording nit: the config text says a "fixed 100,000-work-unit cap", but the limit is min(100000, 16 * G), so small schemas get a lower cap. Saying "up to 100,000" would be more precise.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Document update PR submitted: apache/pulsar-site#1256 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.