Skip to content

[4.1.6-hotfix] fix: return exact BOOL bounds from metadata_scan - #32801

Draft
ck89119 wants to merge 1 commit into
matrixorigin:4.1.6-hotfixfrom
ck89119:issue-32788-4.1.6-hotfix
Draft

ck89119 wants to merge 1 commit into
matrixorigin:4.1.6-hotfixfrom
ck89119:issue-32788-4.1.6-hotfix

Conversation

@ck89119

@ck89119 ck89119 commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

Fixes #32788

What this PR does / why we need it:

metadata_scan() currently exposes the conservative BOOL pruning view as exact user-visible bounds. Consequently, a persisted all-false column reports hex(max) = 01 instead of 00.

Reuse the existing columnSummaryZoneMap implementation when constructing column metadata scan results. It derives exact bounds from persisted BOOL column data where metadata is ambiguous, while preserving the historical-data pruning protection introduced by #32725. Returning raw ZoneMap bytes would not be sufficient: historical mixed false/true data can also have a raw false/false summary.

  • Propagate column-read errors rather than returning an inexact or partial result.
  • Preserve the * object-statistics shortcut, metadata-only handling for non-BOOL/all-true/uninitialized summaries, and existing visibility/tombstone semantics.
  • Reuse the real-object unit-test fixture to cover the metadata consumer, all-false and false+NULL values, multiple blocks, mixed/all-true/all-NULL controls, the statistics shortcut, and cancellation. Retain existing historical-summary and cache-immutability checks.
  • Extend the existing persisted BOOL SQL fixture with five exact metadata min/max checks, alongside independent aggregate and column-summary controls.

Validation on 4.1.6-hotfix@34691aecbb, macOS/arm64, Go 1.26.4, CPU mode:

  • The new metadata-consumer assertions fail against the unchanged base for all-false, false+NULL, and multiblock all-false data: expected max=false, got true.
  • Focused regression tests and the complete pkg/vm/engine/disttae package pass through the repository CGo test wrapper (-count=1).
  • Scoped gofmt, go vet, and golangci-lint 2.6.2 (built with Go 1.26.4) pass; lint reports 0 issues.
  • Native libraries and mo-service build successfully in the worktree.
  • mo-tester generated the expected results; the reviewed result diff contains only the five new metadata outputs. Two normal comparison runs of optimizer/non_primary_zonemap.sql pass 111/111 each, with no ignored or abnormal statements and independent database-teardown checks returning 0.
  • Changed-production-line-intersecting coverage blocks contain 5/5 covered statements (100%); this is not whole-package or branch coverage.

The fix does not change the on-disk format or weaken conservative pruning. Ambiguous BOOL summaries may require reading all blocks of the requested column; the existing implementation loads one column block at a time, releases each load, and stops once both Boolean values are observed.

Limits: historical malformed summaries are covered by the existing real-column/private-metadata fixture, not a new old-binary restart exercise. Multi-CN, Linux CI, race stress, full-repository static analysis, and customer-scale performance were not rerun; local single-CN results do not claim those validations passed.

This branch is being deployed

1 in progress deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/bug Something isn't working kind/test-ci size/S Denotes a PR that changes [10,99] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants