Skip to content

v0.9.2 — Micro-batched index scans no longer fail with 64 or more concurrent clients

Latest

Choose a tag to compare

@github-actions github-actions released this 15 Nov 12:38
· 39 commits to main since this release
21680ce

Micro-batched index scans no longer fail with 64 or more concurrent clients

The GPU regression workflow (gpu.yml) was not run on release/v0.9.2. The fix
below was run on one GPU host: 1x A100-SXM4-80GB, 24 vCPU, PostgreSQL 16.15, cuVS
26.04 built with SDK patches 0001-0004, 0006 and 0007, 999,000 x 768 float32
vectors, L2, LIMIT 10, pgbench in prepared mode, 30 s per run, one run per client
count unless noted. With a cagra index, cuvs.k = 100 and
cuvs.cagra_batch_wait_us = 200, the source of 0.9.1 plus the version bump
(dfdce616) aborted 14 and 11 of 64 clients (two runs) and 461 of 512; the source
of this release aborted none at 64, 128, 256 and 2048 clients. With a flat index,
cuvs.k = 10 and cuvs.bf_batch_wait_us = 200, dfdce616 aborted 4 of 64 clients
and this release none at 64 and 256.

Fixed

  • With a CAGRA or brute-force micro-batch window (cuvs.cagra_batch_wait_us or
    cuvs.bf_batch_wait_us > 0) and 64 pgbench clients, some statements failed with
    GPU daemon unavailable after planning while the daemon was running. A batch
    releases all its waiters at once, every request opens a new connection, and the
    daemon's listen backlog of 32 filled up. A backend whose connect() waited for a
    slot and received a signal failed with EINTR, because the socket's send timeout
    keeps the kernel from restarting the call. PostgreSQL 15 and later backends can receive
    SIGALRM while busy: the idle stats-flush timeout (10 s) is armed when a backend
    goes idle and is not disarmed when the next query starts (postgres.c, "we don't
    disable the timeout below"). Every connect() now waits in 250 ms slices and
    retries after a signal or an expired slice within the call's timeout (30 s for a
    search), and checks for a pending cancel or termination after each attempt.
    cuvs_ipc_search, which CAGRA and flat index scans use, then reports a canceled
    query; the other calls (filtered, streaming, transient brute-force, IVF-PQ and
    batch search, builds) end the connect as before with their connect-failure status.
    A connect that finally fails is logged with its errno ([cuvs_ipc] connect to ... failed; a missing or stale socket stays at debug level). The daemon listens
    with a backlog of 1024, which shortens the wait but is not the fix; the kernel caps
    it at net.core.somaxconn, and the daemon logs a warning at startup when that cap
    is below one batch (256). The scan errors no longer say that the breaker is open
    (retry will use CPU while breaker is open): the per-backend breaker opens only
    after cuvs.circuit_breaker_threshold consecutive failures, and the errors now say
    so. The UNAVAILABLE error reads GPU daemon unavailable after planning; connecting to the daemon socket failed, and its HINT no longer says that the daemon crashed.
    The protocol-mismatch error, which non-scan paths raise too, drops the breaker
    clause. When make_shm_key fails, the plain, batch, filtered, streaming
    brute-force and IVF-PQ search calls no longer pass an uninitialized name to
    shm_unlink. The retry is covered by a Linux unit test against a full
    backlog. (#224)

Upgrading

  • Build the release from its tag, install the extension and the daemon together
    (make install and make install-server), restart PostgreSQL and then the
    daemon, and run ALTER EXTENSION pg_cuvs UPDATE TO '0.9.2'; in each database
    (SELECT extversion FROM pg_extension WHERE extname = 'pg_cuvs' shows 0.9.2
    afterwards). The upgrade script changes no SQL object, and the IPC protocol is
    the one of 0.9.1. The connect retry is in the extension and the larger listen
    backlog is in the daemon. The steps and the restart order are in
    docs/playbooks/release-upgrade.md.