Repository navigation
Conversation
…ersions (apache#70622) Doris converts tablet schemas between `TabletSchemaPB` and `TabletSchemaCloudPB` when exchanging cloud metadata. The optional `variant_escape_dots_in_keys` field defaults to `false`, while protobuf separately tracks whether it was explicitly set. Issue Number: None Related PR: apache#69995 (introduced the field) PR Type: Bugfix Problem Summary: Converting a schema without `variant_escape_dots_in_keys` currently turns the absent field into an explicitly set `false`. Check `has_variant_escape_dots_in_keys()` before setting it in both conversion directions and both copy/move implementations, as requested in Gavin's review of apache#69995. Explicit `false` and `true` values remain present and unchanged; the default value remains `false`. - **Frequency:** Every conversion of a source schema that omits the field. - **Root cause:** Unconditional protobuf setters materialize the default value and set the presence bit. - **Why existing tests missed it:** The policy round-trip test checked values only, so absence and explicit `false` were indistinguishable. The all-fields tests explicitly populate every field. - **Fix:** Guard the four setters with the matching protobuf presence check. Add absent-field coverage and strengthen explicit-value round trips with presence assertions. - **Other paths and branches:** Both cloud/local directions and const-reference/rvalue overloads are covered; the value-returning wrappers delegate to them. This PR targets master. - **Behavior change:** An omitted optional field remains omitted after conversion; explicit values and effective defaults are unchanged. - On dev-x, the new `PBConvertTest.VariantEscapeTablePolicyAbsent` fails before the fix: presence becomes `true` in all four conversion paths for absent input fields. - After the fix, ASAN `./run-be-ut.sh --run --filter="PbConvert.*:PBConvertTest.*:TabletSchemaTest.*"` passes all 42 tests across three suites. This host's UT invocation uses `GLIBC_COMPATIBILITY=OFF` to avoid duplicate compatibility symbols with its LDB toolchain; this is a test-only setting. - clang-format 16, the format check, and changed-line clang-tidy all pass. None - Behavior changed: Yes (see Details) - Does this need documentation: No - Pre-submission status: Ready - Tool: OpenAI Codex (GPT-6) - Generated: Code, tests, and this description. - Human review: Pending author review. (cherry picked from commit 256e786)
Member
Author
|
run buildall |
Member
Author
|
run beut |
1 similar comment
Member
Author
|
run beut |
Member
Author
|
run nonConcurrent |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
cherry-pick #70622
Conflicts in be/src/cloud/pb_convert.cpp were resolved by guarding the existing branch-4.2 setters with has_variant_escape_dots_in_keys() and not bringing in unrelated master-only fields.