Skip to content

[Bug]: First ordinary IVF query can fail during clean 2-CN startup despite SQL readiness #29476

Closed

Description

@XuPeng-SH

Observation

Found during clean two-CN BVT validation for #29462. After SELECT 1 succeeded, the first ordinary (not prepared) IVF query failed with:

internal error: query schedule cannot satisfy placement, reason required-current-cn-outside-pool, current CN policy required

The following 63 statements in vector/vector_ivf_prepare_dist_range.sql, including prepared reuse and NULL controls, succeeded. The preceding prepared-filter BVT succeeded 61/61. No CN kill, label mutation or session migration was involved.

Environment and evidence

  • Fresh empty data directory on local NVMe; same-process launch with two CN services, TN and log service, using etc/launch-multi-cn.
  • PR fix: restore prepared TPCC filter selectivity with per-binding proof #29462 local revision: 51c799752f625c5cd1ff51edaa12b3c2955eca77 plus its source-binding changes under review; merge base a543410f766d2f41237519ed7cc1376c31e03d99.
  • Binary SHA256: ac124dedc8d664daeb506bce35501540f0a3cdd6225774b3f8c2f91260a03c01.
  • 2026-09-29 01:06:20.884/20.939 -0400: both CNs logged CN is visible in local cluster inventory.
  • 01:06:29.845 -0400: first ordinary IVF query failed. Scheduler fields:
current-cn-id=dd1dccb4-4d3c-41f8-b482-5251dc7a41bf
current-cn-address=127.0.0.1:18100
reason=required-current-cn-outside-pool
current-cn-policy=required
exec-type=ap-multi-cn
worker-count=0 eligible-worker-count=0 dropped-worker-count=0
requested-pool=tenant:3:sys resolved-pool=all-compatible
pool-fallback=false worker-set=all require-current-cn=true is-internal=false

Reproduction sequence

  1. Start a fresh two-CN launch and poll SELECT 1 through CN1.
  2. As soon as SQL is available, run prepare/issue_29429_prepared_filter.sql, then vector/vector_ivf_prepare_dist_range.sql through CN1.
  3. Observe the first literal control:
create table t(id int primary key, v vecf32(3));
insert into t values (1,'[1,1,1]'),(2,'[2,2,2]'),(3,'[9,9,9]'),(4,'[10,10,10]');
create index idx using ivfflat on t(v) lists=1 op_type 'vector_l2_ops';
select id from t where l2_distance(v,'[1,1,1]') < 5
order by l2_distance(v,'[1,1,1]') limit 2;

Expected IDs: 1, 2. Observed: placement error. This is a timing-sensitive observation, not a deterministic 3/3 reproducer.

Controls and investigation boundary

On another fresh cluster, explicitly observing both expected CNs as Working with SHOW BACKEND SERVERS before starting BVT resulted in 500/500 successes: both cases, twice on each CN. This command forces an inventory refresh, so it is not a passive observation and does not establish that the product startup race is fixed.

Two clean startup probes with the unmodified direct parent 1575e70c3db676d3ed00abc080aadc029b0e1435 did not reproduce the failure. One refreshed inventory before querying; the other ran the ordinary IVF query immediately after SQL readiness. Baseline reproduction is therefore unconfirmed.

The relevant startup/candidate-discovery code is unchanged between that parent, this PR's merge base, and the working tree. A boundary to investigate is that waitForClusterSelfReady checks the raw self inventory/generation, while DiscoverQueryCandidates uses admission-aware inventory and can filter CNs whose View metadata admission is not ready. The failure log alone does not prove which field caused the empty candidate set.

Related #27152 addressed a replacement-CN stale inventory window. This observation is a clean startup with zero eligible workers, after the existing self-inventory readiness check, so it should be investigated separately rather than assumed to be the same fixed failure.

This issue tracks the separate startup contract; #29462 does not claim to fix it or relax placement checks. Original failure logs, the successful readiness-gated rerun and both baseline controls are retained under the local issue-29429-perf evidence directory.

Activity

  1. added
    kind/bug
    on Sep 29, 2026
  2. self-assigned this
    on Sep 29, 2026
  3. added a commit that references this issue on Sep 30, 2026
    0d36870
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions