Skip to content

test: avoid stale HNSW cache in multi-CN BVT - #27631

Merged
XuPeng-SH merged 2 commits into
mainfrom
fix/hnsw-bvt-cross-cn-cache
Aug 26, 2026
Merged

XuPeng-SH merged 2 commits into
mainfrom
fix/hnsw-bvt-cross-cn-cache

Conversation

@XuPeng-SH

@XuPeng-SH XuPeng-SH commented Aug 26, 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 relates to:

What this PR does / why we need it:

This PR is a BVT-side workaround, not a production fix for cross-CN HNSW cache invalidation.

The original multi-CN HNSW regression deliberately completed all INSERT/DELETE/UPDATE work before the first indexed SELECT. Its comment documented the existing limitation: once a CN loads an HNSW model into memory, CDC publication on another CN may not refresh that cached generation.

PR #27607 consolidated the independent initial-build and bulk-delta cases onto the same f32 table. As a result, the consolidated case queried the first 10K generation before loading the second 10K CDC delta. That newly coupled ordering warmed the first-generation model on the query CN. In a multi-CN run, the async consumer could materialize the delta on another CN while the query CN continued serving the cached first generation. The failing jobs therefore returned old-generation neighbor 2638 instead of delta endpoint 19999 for the full 120-second wait window, even after the metadata checksum changed.

This change restores the original regression boundary and ordering:

  • keep the independent first-generation f64 HNSW black-box oracle;
  • keep the f32 model cache cold until the second 10K CDC load is materialized;
  • make the delta endpoint probe the first f32 HNSW read;
  • retain final f32 delta-admission checks for IDs 10000 and 19999;
  • retain final f32 base-retention checks for IDs 0 and 9999.

The core #22794 purpose remains covered: after a parallel bulk delta, the published f32 generation must contain both the original base endpoints and the delta-only endpoints. This PR removes the pre-delta f32 black-box checkpoint that was introduced by the consolidated ordering; it does not claim that the complete historical test matrix is identical, and it does not prove that a warm CN refreshes its cached model.

The production contract remains tracked by #27632: a CN that has already loaded an older generation must converge to a newly published generation. Once that production defect is fixed, it needs a dedicated native multi-CN regression that deliberately warms the old model before publishing the new generation.

No timeout or retry is increased. No production code is changed. Two pre-delta f32 ANN searches are removed.

Validation

  • Verified the SQL and golden command remain synchronized after the rewrite.
  • Verified no t2_f32 HNSW read occurs before the second bulk load.
  • Verified all four final f32 semantic oracles remain in both SQL and golden output.
  • git diff --check passes.

A local attempt reused the exact x86_64 mo-service artifact from the failing run, but native HNSW crashed under arm64 Docker emulation during the initial model build. That environment-only run is not counted as validation; native x86 multi-CN CI is the relevant execution gate.

Failure evidence:

@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 →

@mergify mergify Bot added the kind/test-ci label Aug 26, 2026
@XuPeng-SH
XuPeng-SH force-pushed the fix/hnsw-bvt-cross-cn-cache branch from 5e3104b to e8919b6 Compare August 26, 2026 06:24
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR relates to:

- BVT symptom: matrixorigin#27629
- Production root cause: matrixorigin#27632
- Historical async-update regression: matrixorigin#22794

## What this PR does / why we need it:

This PR is a **BVT-side workaround**, not a production fix for cross-CN
HNSW cache invalidation.

The original multi-CN HNSW regression deliberately completed all
INSERT/DELETE/UPDATE work before the first indexed SELECT. Its comment
documented the existing limitation: once a CN loads an HNSW model into
memory, CDC publication on another CN may not refresh that cached
generation.

PR matrixorigin#27607 consolidated the independent initial-build and bulk-delta
cases onto the same f32 table. As a result, the consolidated case
queried the first 10K generation before loading the second 10K CDC
delta. That newly coupled ordering warmed the first-generation model on
the query CN. In a multi-CN run, the async consumer could materialize
the delta on another CN while the query CN continued serving the cached
first generation. The failing jobs therefore returned old-generation
neighbor 2638 instead of delta endpoint 19999 for the full 120-second
wait window, even after the metadata checksum changed.

This change restores the original regression boundary and ordering:

- keep the independent first-generation f64 HNSW black-box oracle;
- keep the f32 model cache cold until the second 10K CDC load is
materialized;
- make the delta endpoint probe the first f32 HNSW read;
- retain final f32 delta-admission checks for IDs 10000 and 19999;
- retain final f32 base-retention checks for IDs 0 and 9999.

The core matrixorigin#22794 purpose remains covered: after a parallel bulk delta,
the published f32 generation must contain both the original base
endpoints and the delta-only endpoints. This PR removes the pre-delta
f32 black-box checkpoint that was introduced by the consolidated
ordering; it does not claim that the complete historical test matrix is
identical, and it does not prove that a warm CN refreshes its cached
model.

The production contract remains tracked by matrixorigin#27632: a CN that has already
loaded an older generation must converge to a newly published
generation. Once that production defect is fixed, it needs a dedicated
native multi-CN regression that deliberately warms the old model before
publishing the new generation.

No timeout or retry is increased. No production code is changed. Two
pre-delta f32 ANN searches are removed.

### Validation

- Verified the SQL and golden command remain synchronized after the
rewrite.
- Verified no `t2_f32` HNSW read occurs before the second bulk load.
- Verified all four final f32 semantic oracles remain in both SQL and
golden output.
- `git diff --check` passes.

A local attempt reused the exact x86_64 `mo-service` artifact from the
failing run, but native HNSW crashed under arm64 Docker emulation during
the initial model build. That environment-only run is not counted as
validation; native x86 multi-CN CI is the relevant execution gate.

Failure evidence:

-
https://github.com/matrixorigin/matrixone/actions/runs/32930733336/job/98063525521
-
https://github.com/matrixorigin/matrixone/actions/runs/32926456273/job/98051500919?pr=27621
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR relates to:

- BVT symptom: matrixorigin#27629
- Production root cause: matrixorigin#27632
- Historical async-update regression: matrixorigin#22794

## What this PR does / why we need it:

This PR is a **BVT-side workaround**, not a production fix for cross-CN
HNSW cache invalidation.

The original multi-CN HNSW regression deliberately completed all
INSERT/DELETE/UPDATE work before the first indexed SELECT. Its comment
documented the existing limitation: once a CN loads an HNSW model into
memory, CDC publication on another CN may not refresh that cached
generation.

PR matrixorigin#27607 consolidated the independent initial-build and bulk-delta
cases onto the same f32 table. As a result, the consolidated case
queried the first 10K generation before loading the second 10K CDC
delta. That newly coupled ordering warmed the first-generation model on
the query CN. In a multi-CN run, the async consumer could materialize
the delta on another CN while the query CN continued serving the cached
first generation. The failing jobs therefore returned old-generation
neighbor 2638 instead of delta endpoint 19999 for the full 120-second
wait window, even after the metadata checksum changed.

This change restores the original regression boundary and ordering:

- keep the independent first-generation f64 HNSW black-box oracle;
- keep the f32 model cache cold until the second 10K CDC load is
materialized;
- make the delta endpoint probe the first f32 HNSW read;
- retain final f32 delta-admission checks for IDs 10000 and 19999;
- retain final f32 base-retention checks for IDs 0 and 9999.

The core matrixorigin#22794 purpose remains covered: after a parallel bulk delta,
the published f32 generation must contain both the original base
endpoints and the delta-only endpoints. This PR removes the pre-delta
f32 black-box checkpoint that was introduced by the consolidated
ordering; it does not claim that the complete historical test matrix is
identical, and it does not prove that a warm CN refreshes its cached
model.

The production contract remains tracked by matrixorigin#27632: a CN that has already
loaded an older generation must converge to a newly published
generation. Once that production defect is fixed, it needs a dedicated
native multi-CN regression that deliberately warms the old model before
publishing the new generation.

No timeout or retry is increased. No production code is changed. Two
pre-delta f32 ANN searches are removed.

### Validation

- Verified the SQL and golden command remain synchronized after the
rewrite.
- Verified no `t2_f32` HNSW read occurs before the second bulk load.
- Verified all four final f32 semantic oracles remain in both SQL and
golden output.
- `git diff --check` passes.

A local attempt reused the exact x86_64 `mo-service` artifact from the
failing run, but native HNSW crashed under arm64 Docker emulation during
the initial model build. That environment-only run is not counted as
validation; native x86 multi-CN CI is the relevant execution gate.

Failure evidence:

-
https://github.com/matrixorigin/matrixone/actions/runs/32930733336/job/98063525521
-
https://github.com/matrixorigin/matrixone/actions/runs/32926456273/job/98051500919?pr=27621
VioletQwQ-0 pushed a commit to VioletQwQ-0/matrixone that referenced this pull request Sep 17, 2026
## What type of PR is this?

- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [x] Test and CI
- [ ] Code Refactoring

## Which issue(s) this PR relates to:

- BVT symptom: matrixorigin#27629
- Production root cause: matrixorigin#27632
- Historical async-update regression: matrixorigin#22794

## What this PR does / why we need it:

This PR is a **BVT-side workaround**, not a production fix for cross-CN
HNSW cache invalidation.

The original multi-CN HNSW regression deliberately completed all
INSERT/DELETE/UPDATE work before the first indexed SELECT. Its comment
documented the existing limitation: once a CN loads an HNSW model into
memory, CDC publication on another CN may not refresh that cached
generation.

PR matrixorigin#27607 consolidated the independent initial-build and bulk-delta
cases onto the same f32 table. As a result, the consolidated case
queried the first 10K generation before loading the second 10K CDC
delta. That newly coupled ordering warmed the first-generation model on
the query CN. In a multi-CN run, the async consumer could materialize
the delta on another CN while the query CN continued serving the cached
first generation. The failing jobs therefore returned old-generation
neighbor 2638 instead of delta endpoint 19999 for the full 120-second
wait window, even after the metadata checksum changed.

This change restores the original regression boundary and ordering:

- keep the independent first-generation f64 HNSW black-box oracle;
- keep the f32 model cache cold until the second 10K CDC load is
materialized;
- make the delta endpoint probe the first f32 HNSW read;
- retain final f32 delta-admission checks for IDs 10000 and 19999;
- retain final f32 base-retention checks for IDs 0 and 9999.

The core matrixorigin#22794 purpose remains covered: after a parallel bulk delta,
the published f32 generation must contain both the original base
endpoints and the delta-only endpoints. This PR removes the pre-delta
f32 black-box checkpoint that was introduced by the consolidated
ordering; it does not claim that the complete historical test matrix is
identical, and it does not prove that a warm CN refreshes its cached
model.

The production contract remains tracked by matrixorigin#27632: a CN that has already
loaded an older generation must converge to a newly published
generation. Once that production defect is fixed, it needs a dedicated
native multi-CN regression that deliberately warms the old model before
publishing the new generation.

No timeout or retry is increased. No production code is changed. Two
pre-delta f32 ANN searches are removed.

### Validation

- Verified the SQL and golden command remain synchronized after the
rewrite.
- Verified no `t2_f32` HNSW read occurs before the second bulk load.
- Verified all four final f32 semantic oracles remain in both SQL and
golden output.
- `git diff --check` passes.

A local attempt reused the exact x86_64 `mo-service` artifact from the
failing run, but native HNSW crashed under arm64 Docker emulation during
the initial model build. That environment-only run is not counted as
validation; native x86 multi-CN CI is the relevant execution gate.

Failure evidence:

-
https://github.com/matrixorigin/matrixone/actions/runs/32930733336/job/98063525521
-
https://github.com/matrixorigin/matrixone/actions/runs/32926456273/job/98051500919?pr=27621

This branch was previously deployed

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

Labels

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