apurtell commented on PR #2624: URL: https://github.com/apache/phoenix/pull/2624#issuecomment-5861669496
Force push maintains the phased structure while applying fixes from self-review. Each fix was rebased into the phase commit that introduced the bug, so every intermediate phase remains individually correct and compiles/tests cleanly on its own. ## Significant issues - **Phase 4** — `SYSTEM.VECTOR_CENTROID` primary key was missing `GENERATION_ID`, not fixed until phase 13, so two centroid generations could never coexist during a rebuild. Corrected. - **Phase 6** — `VectorCentroidCache` could be poisoned. Now untrained lookups are not cached. - **Phase 8** — Vector search through a view silently dropped rows instead of falling back to a full scan. `canScopeCentroidRanges` now forces a full-index fallback when `viewIndexId != null`. - **Phase 13** — A failed background rebuild left the `BUILDING` flag never cleared and staged next-generation rows were not cleaned up. Now the abandoned generation's centroid/summary rows are discarded. - **Phase 13** — Posting-list skew ratio used mean instead of median. Now computed against the true median cluster size. ## Important issues - **Phase 2** — JDK21 SIMD (`*WithBound`) distance paths computed the full distance before checking the bound, defeating early termination. Now they check the bound per SIMD lane batch. - **Phase 3** — A dimension-mismatched literal query vector wasn't caught at compile time, surfacing as a raw `IllegalArgumentException` at scan time instead of a clean `SQLException`. Fixed. - **Phase 5** — `DROP INDEX`/`DROP TABLE` swallowed `SYSTEM.VECTOR_CENTROID` cleanup failures at DEBUG, silently orphaning rows. Now logged at WARN. - **Phase 6** — Concurrent query-side cache misses for the same key could double-load centroids. Added single-flight locking to `loadCentroids()`. - **Phase 6** — Distributed empty-cluster re-seeding could assign the same worst-fit vector to multiple empty clusters. Candidates are now selected distinctly, most-severe first. - **Phase 6** — Post-split rebalancing could leave an empty "phantom" sub-centroid with no re-seed path. Empty clusters are now re-seeded from the worst-fit point in an overfull cluster. - **Phase 10** — `BsonVectorValueFunction.evaluate()` returned `false` for a missing/NULL path instead of `true` with an empty ptr, violating `Expression`'s contract. Fixed. - **Phase 14** — Compatibility gating checked `SYSTEM.CATALOG` schema only, not live per-server coprocessor version, allowing a client to pass the gate and write to a region still served by old code during a rolling upgrade. `Feature.VECTOR_INDEX` now requires both the schema check and a live flag. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
