Repository navigation
Description
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:
51c799752f625c5cd1ff51edaa12b3c2955eca77plus its source-binding changes under review; merge basea543410f766d2f41237519ed7cc1376c31e03d99. - 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
- Start a fresh two-CN launch and poll
SELECT 1through CN1. - As soon as SQL is available, run
prepare/issue_29429_prepared_filter.sql, thenvector/vector_ivf_prepare_dist_range.sqlthrough CN1. - 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
fix: restore prepared TPCC filter selectivity with per-binding proof (#…
fix(cn): wait for admitted query inventory before SQL startup (#29526)