Skip to content

[fix](be) Respect tuple delete-sign slots in point queries - #70567

Open
ziyinweixiao wants to merge 1 commit into
apache:masterfrom
ziyinweixiao:fix/point-query-delete-sign-projection
Open

ziyinweixiao wants to merge 1 commit into
apache:masterfrom
ziyinweixiao:fix/point-query-delete-sign-projection

Conversation

@ziyinweixiao

Copy link
Copy Markdown

Background

Short-circuit point queries read projected values from row-store JSONB and fetch missing columns from column storage. Normal visibility also needs a delete-sign tuple slot even when SELECT does not project it.

What problem does this PR solve?

Issue Number: None
Related PR: None
PR Type: Bugfix

Problem Summary:
With show_hidden_columns=true, a partial-row-store SELECT v can have no delete-sign tuple slot. Adding the schema delete-sign UID unconditionally then causes unordered_map::at to abort the BE during column-store fallback. Request the delete-sign column only when its tuple slot exists, and retain fallback reads when a cached row-store payload cannot supply all columns.

Details

  • Frequency: Reproduced on a partial row store with debug visibility and a projected ordinary column.
  • Root cause: The requested UID set included a delete-sign column absent from the tuple UID map.
  • Why existing tests missed it: Hidden-column tests select hidden columns and bypass short circuit; they do not cover ordinary projections with debug visibility on a partial row store.
  • Fix: Derive the delete-sign index from the tuple and add its actual slot to the requested set. Skip the payload-only cache fast path when column-store reads are required.
  • Other paths and branches: Both synchronous and read-ahead fallback use the corrected UID set. Normal delete filtering is preserved. No wire, schema or persisted-format changes.

Testing

  • Reproduced the original SIGABRT on unmodified adad294.
  • Official ASAN BE build passed.
  • Official regression runner passed test_point_query_delete_sign_projection, test_short_circuit_rowset_hidden_columns and test_point_query_light_schema_change.
  • The new regression passed with row cache disabled and enabled; the final run also enabled query read-ahead and asynchronous file-cache writes.
  • Four descriptor unit tests added; matching-toolchain syntax check passed. The BE unit-test executable was not built or run.
  • Official clang-format 16, build hygiene and changed-line clang-tidy passed.

Release note

Fix BE crashes when short-circuit point queries read ordinary columns from partial row-store tables with show_hidden_columns enabled. Mixed projections continue to fetch columns that are not present in the cached row-store payload.

Check List (For Author)

  • Behavior changed: Yes (see Details).
  • Does this need documentation: No.
  • Pre-submission status: Partially verified: BE unit-test execution remains for CI.

AI Disclosure

  • Tool: Codex, GPT-6.1 Sol.
  • Generated: Code, tests and this description.
  • Human review: Pending.

Background

What problem does this PR solve?

Issue Number:
Related PR:
PR Type:

Problem Summary:

Details

Testing

Notes for Reviewers

Release note

Check List (For Author)

  • Behavior changed:
  • Does this need documentation:
  • Pre-submission status:

AI Disclosure

  • Tool:
  • Generated:
  • Human review:

### Background

Short-circuit point queries read projected values from row-store JSONB and
fetch missing columns from column storage. Normal visibility also needs a
delete-sign tuple slot even when SELECT does not project it.

### What problem does this PR solve?

Issue Number: None
Related PR: None
PR Type: Bugfix

Problem Summary:
With show_hidden_columns=true, a partial-row-store SELECT v can have no
delete-sign tuple slot. Adding the schema delete-sign UID unconditionally
then causes unordered_map::at to abort the BE during column-store fallback.
Request the delete-sign column only when its tuple slot exists, and retain
fallback reads when a cached row-store payload cannot supply all columns.

### Details

- **Frequency:** Reproduced on a partial row store with debug visibility and a projected ordinary column.
- **Root cause:** The requested UID set included a delete-sign column absent from the tuple UID map.
- **Why existing tests missed it:** Hidden-column tests select hidden columns and bypass short circuit; they do not cover ordinary projections with debug visibility on a partial row store.
- **Fix:** Derive the delete-sign index from the tuple and add its actual slot to the requested set. Skip the payload-only cache fast path when column-store reads are required.
- **Other paths and branches:** Both synchronous and read-ahead fallback use the corrected UID set. Normal delete filtering is preserved. No wire, schema or persisted-format changes.

### Testing

- Reproduced the original SIGABRT on unmodified adad294.
- Official ASAN BE build passed.
- Official regression runner passed test_point_query_delete_sign_projection,
  test_short_circuit_rowset_hidden_columns and test_point_query_light_schema_change.
- The new regression passed with row cache disabled and enabled; the final
  run also enabled query read-ahead and asynchronous file-cache writes.
- Four descriptor unit tests added; matching-toolchain syntax check passed.
  The BE unit-test executable was not built or run.
- Official clang-format 16, build hygiene and changed-line clang-tidy passed.

### Release note

Fix BE crashes when short-circuit point queries read ordinary columns from
partial row-store tables with show_hidden_columns enabled. Mixed projections
continue to fetch columns that are not present in the cached row-store payload.

### Check List (For Author)

- Behavior changed: Yes (see Details).
- Does this need documentation: No.
- Pre-submission status: Partially verified: BE unit-test execution remains for CI.

### AI Disclosure

- Tool: Codex, GPT-6.1 Sol.
- Generated: Code, tests and this description.
- Human review: Pending.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant