Skip to content

fix async ivfflat include and generated column updates - #29698

Merged
XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-29053-29012-main-v2
Oct 12, 2026
Merged

XuPeng-SH merged 3 commits into
matrixorigin:mainfrom
iamlinjunhong:codex/issue-29053-29012-main-v2

Conversation

@iamlinjunhong

Copy link
Copy Markdown
Contributor

What changed

Fixes async IVFFLAT CDC/ISCP maintenance and synchronous generated-column invalidation for the six related bugs:

Validation

  • GOWORK=off go test -mod=mod -count=1 -timeout 180s ./pkg/iscp ./pkg/sql/plan ./pkg/sql/parsers/dialect/mysql
  • GOWORK=off go vet -mod=mod ./pkg/iscp ./pkg/sql/plan ./pkg/sql/parsers/dialect/mysql
  • Focused regressions cover special-value SQL generation and parsing, transitive generated dependencies, quantized vector projection ordering, and existing INCLUDE behavior.

CGo linker output contains the repository's existing duplicate-rpath/native-library warnings; all selected tests and vet completed successfully.

@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@matrix-meow matrix-meow added the size/M Denotes a PR that changes [100,499] lines label Oct 8, 2026
@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: f0489f508cb0c8040877bfb2f4752268a830f5a2

Assessment: request_changes

Reviewed the complete six-file delta and its callers. Timestamp value preservation remains incomplete, and the new generated-column dependency traversal introduces exponential planning work.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

  • P2 pkg/iscp/util.go:422: Replay an async IVFFLAT row whose INCLUDE column is TIMESTAMP(6), containing 2026-01-02 03:04:05.123456.
    Impact: The hidden index still loses fractional seconds, potentially changing covering-query values and filtering results. This is an unresolved part of the stated timestamp repair, rather than a newly introduced precision regression. Preserve the declared scale through the intermediate SQL casts.
    Evidence: appendTimestampSQL preserves the raw bytes, but index_sqlwriter.go:757-773 constructs CAST(column_N AS TIMESTAMP) using Type.DescString(), which omits temporal scale. The parser defaults that cast to scale 0; timestampToTimestamp applies TruncateToScale(0). The extracted-function host probe in timestamp_probe.log produces 03:04:05.000000; .987654 rounds to the next second. The new test only parses the standalone literal and misses this consumer boundary.

  • P2 pkg/sql/plan/bind_update.go:4666: Use an indexed generated column, or INCLUDE column, with repeated dependencies such as g1=g0+g0 through g24=g23+g23, then update an unrelated payload column through ODKU.
    Impact: Deleting each visited entry on return makes the traversal enumerate dependency paths instead of distinct columns. Small schemas therefore cause exponential CPU work during planning. Reuse the existing generated-column dependency closure or memoize completed results.
    Evidence: The extracted current-head closure performed 33,554,431 visits at depth 24; the merge-base closure performed one. Results are recorded in dependency_probe.log and dependency_base_probe.log. collectRefColPos retains duplicate references, and splitIrregularIndexesByUpdatedColumns reaches this helper even though bind_insert.go:2811 already computes possiblyChangedCols using collectGeneratedColumnDependents. The added tests contain only simple chains and do not exercise shared dependencies.

Validation:

  • Verified the frozen HEAD, clean source checkout, complete delta and git diff --check.

  • Traced serialization through row extraction, writer projection, casts and consumer error/reset handling; traced UPDATE/ODKU dependency ownership and plugin hooks.

  • Verified that vector slot 1 matches the constructor layout and single-vector-column schema restriction. Plugin candidate checks found no new algorithm dispatch, dependency imports or removed interface assertions.

  • Reused frozen exact-head build, Ubuntu UT, arm64 SCA, coverage and multi-CN BVT successes, plus the author's reported iscp/plan/mysql package tests and vet.

  • Ran bounded standalone host probes with changed-source functions and explicit adapters. Probe sources, logs, SQL witnesses and review-record.json are under the assigned attempt directory.

Limitations:

  • Host probes establish traversal growth and scalar conversion behavior; they are not production SQL executions or whole-query benchmarks.

  • The repository provenance verifier rejected the retained native library because its stamp was missing. No local native tests or service were launched.

  • New CDC value round-trips and quantized INCLUDE storage behavior lack targeted public-path evidence in the supplied record; the added tests primarily assert generated SQL and parsing.

  • Linked issue bodies were not supplied. Reviewed their contracts as stated in the frozen PR description; supplied comments contain no substantive review concerns.

@XuPeng-SH XuPeng-SH 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.

mo-bot review · mo-bot-local · review

Commit: f0489f508cb0c8040877bfb2f4752268a830f5a2

Assessment: request_changes

Reviewed the complete six-file delta and its callers. Timestamp value preservation remains incomplete, and the new generated-column dependency traversal introduces exponential planning work.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

  • P2 pkg/iscp/util.go:422: Replay an async IVFFLAT row whose INCLUDE column is TIMESTAMP(6), containing 2026-01-02 03:04:05.123456.
    Impact: The hidden index still loses fractional seconds, potentially changing covering-query values and filtering results. This is an unresolved part of the stated timestamp repair, rather than a newly introduced precision regression. Preserve the declared scale through the intermediate SQL casts.
    Evidence: appendTimestampSQL preserves the raw bytes, but index_sqlwriter.go:757-773 constructs CAST(column_N AS TIMESTAMP) using Type.DescString(), which omits temporal scale. The parser defaults that cast to scale 0; timestampToTimestamp applies TruncateToScale(0). The extracted-function host probe in timestamp_probe.log produces 03:04:05.000000; .987654 rounds to the next second. The new test only parses the standalone literal and misses this consumer boundary.

  • P2 pkg/sql/plan/bind_update.go:4666: Use an indexed generated column, or INCLUDE column, with repeated dependencies such as g1=g0+g0 through g24=g23+g23, then update an unrelated payload column through ODKU.
    Impact: Deleting each visited entry on return makes the traversal enumerate dependency paths instead of distinct columns. Small schemas therefore cause exponential CPU work during planning. Reuse the existing generated-column dependency closure or memoize completed results.
    Evidence: The extracted current-head closure performed 33,554,431 visits at depth 24; the merge-base closure performed one. Results are recorded in dependency_probe.log and dependency_base_probe.log. collectRefColPos retains duplicate references, and splitIrregularIndexesByUpdatedColumns reaches this helper even though bind_insert.go:2811 already computes possiblyChangedCols using collectGeneratedColumnDependents. The added tests contain only simple chains and do not exercise shared dependencies.

Validation:

  • Verified the frozen HEAD, clean source checkout, complete delta and git diff --check.

  • Traced serialization through row extraction, writer projection, casts and consumer error/reset handling; traced UPDATE/ODKU dependency ownership and plugin hooks.

  • Verified that vector slot 1 matches the constructor layout and single-vector-column schema restriction. Plugin candidate checks found no new algorithm dispatch, dependency imports or removed interface assertions.

  • Reused frozen exact-head build, Ubuntu UT, arm64 SCA, coverage and multi-CN BVT successes, plus the author's reported iscp/plan/mysql package tests and vet.

  • Ran bounded standalone host probes with changed-source functions and explicit adapters. Probe sources, logs, SQL witnesses and review-record.json are under the assigned attempt directory.

Limitations:

  • Host probes establish traversal growth and scalar conversion behavior; they are not production SQL executions or whole-query benchmarks.

  • The repository provenance verifier rejected the retained native library because its stamp was missing. No local native tests or service were launched.

  • New CDC value round-trips and quantized INCLUDE storage behavior lack targeted public-path evidence in the supplied record; the added tests primarily assert generated SQL and parsing.

  • Linked issue bodies were not supplied. Reviewed their contracts as stated in the frozen PR description; supplied comments contain no substantive review concerns.

@XuPeng-SH

XuPeng-SH commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

mo-bot review · mo-bot-local · done

Commit: cd98fbd4bc0f52a865474f06e917a4b1021e23d2

Assessment: approve

Reviewed the complete eight-file delta and its callers. Both previous findings are resolved: temporal casts preserve fractional scale, and generated-column dependency traversal retains visited nodes. Serialization, quantization ordering, UPDATE/ODKU maintenance, and existing CDC lifecycle ownership are consistent. No actionable unresolved findings remain.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • Traced special-value serialization through SQL binding and conversion, including BIT bytes, timestamp timezone/scale handling, and mixed NULL rows.

  • Reviewed regression assertions for stored INCLUDE values, snapshot and incremental CDC, updates/deletes, timezone changes, generated dependencies, and quantized projection ordering.

  • Reused frozen exact-head successful Ubuntu/x86 UT, Linux/arm64 SCA, coverage, PROXY BVT, and PESSIMISTIC BVT evidence; checked repository selection of the new vector SQL case.

  • Standalone probe of the extracted dependency traversal passed shared-reference cases at depths 8, 16, 24, and 128, expanding each generated node at most once.

  • Exact HEAD verified; checkout clean; diff whitespace and Go formatting checks passed. Detailed audit and probe artifacts are retained in the attempt directory.

Limitations:

  • CI evidence provides suite conclusions, not individual BVT logs. No local repository/native tests were rerun.

  • The standalone traversal probe uses stub surroundings; it is not production-planner validation or a SQL performance benchmark.

  • Separate linked-issue bodies were not supplied; issue contracts were assessed from the frozen PR description and review comments.

@XuPeng-SH XuPeng-SH 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.

mo-bot review · mo-bot-local · review

Commit: cd98fbd4bc0f52a865474f06e917a4b1021e23d2

Assessment: approve

Reviewed the complete eight-file delta and its callers. Both previous findings are resolved: temporal casts preserve fractional scale, and generated-column dependency traversal retains visited nodes. Serialization, quantization ordering, UPDATE/ODKU maintenance, and existing CDC lifecycle ownership are consistent. No actionable unresolved findings remain.

Model: gpt-6-astra / xhigh

Session: 01a12d8f-7dea-77c2-a565-38d45b5564e4 · slot 0 · generation 0

Validation:

  • Traced special-value serialization through SQL binding and conversion, including BIT bytes, timestamp timezone/scale handling, and mixed NULL rows.

  • Reviewed regression assertions for stored INCLUDE values, snapshot and incremental CDC, updates/deletes, timezone changes, generated dependencies, and quantized projection ordering.

  • Reused frozen exact-head successful Ubuntu/x86 UT, Linux/arm64 SCA, coverage, PROXY BVT, and PESSIMISTIC BVT evidence; checked repository selection of the new vector SQL case.

  • Standalone probe of the extracted dependency traversal passed shared-reference cases at depths 8, 16, 24, and 128, expanding each generated node at most once.

  • Exact HEAD verified; checkout clean; diff whitespace and Go formatting checks passed. Detailed audit and probe artifacts are retained in the attempt directory.

Limitations:

  • CI evidence provides suite conclusions, not individual BVT logs. No local repository/native tests were rerun.

  • The standalone traversal probe uses stub surroundings; it is not production-planner validation or a SQL performance benchmark.

  • Separate linked-issue bodies were not supplied; issue contracts were assessed from the frozen PR description and review comments.

@mergify

mergify Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

This branch was previously deployed

1 inactive deployment
ci — aae7d353 Deployed Oct 12, 2026 by XuPeng-SH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes [500,999] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants