Skip to content

gRPC vector search RPCs cannot run inside a client transaction #7326

Closed

Description

@robfrank

Split out of #7306, which added VectorSearch, HybridSearch and FullTextSearch to arcadedb-server.proto alongside the matching HTTP routes.

The three new request messages carry database and credentials but no TransactionContext, unlike LookupByRidRequest, ExecuteQueryRequest and ExecuteCommandRequest. So a search issued while the client holds an open gRPC transaction runs outside it and cannot see that transaction's uncommitted writes.

The HTTP side does not have this gap. AbstractVectorSearchHandler extends DatabaseAbstractHandler, which runs the handler inside the session's transaction when the request carries arcadedb-session-id - so an HTTP client that opened a session and inserted a record can immediately find it through POST /api/v1/vector/{database}/search, and a gRPC client doing the equivalent cannot.

Shape of the fix

ArcadeDbGrpcService.lookupByRid is the pattern to follow: resolve the incoming transaction with resolveAuthorizedTransaction, reject an id the server no longer knows with unknownTransactionStatus, and run the body on the transaction's own thread through submitToActiveTransaction so the reads are tracked in that transaction. The three search handlers currently go straight to getDatabase(...) inside GrpcUnaryCall.respond.

That needs one new optional field on each of the three request messages:

TransactionContext transaction = 15;   // VectorSearchRequest
TransactionContext transaction = 15;   // HybridSearchRequest
TransactionContext transaction = 8;    // FullTextSearchRequest

and the matching plumbing in RemoteGrpcDatabase.vectorSearch / hybridSearch / fullTextSearch, which today set only the database and credentials from the connection.

Verification

  • A test that opens a gRPC transaction, inserts a vertex whose embedding is the exact query vector, and asserts the search finds it before the commit - which fails against the current code because the search runs outside the transaction.
  • The same test over HTTP with a session id, asserting the two protocols agree, since that equivalence is what HTTP API has no streaming query and no vector search endpoint #7306 set out to establish.

Activity

  1. added
    enhancement
    grpc
    vector
    on Sep 9, 2026
  2. added
    in progress
    on Sep 9, 2026
  3. added this to the 26.10.1 milestone on Sep 9, 2026
  4. self-assigned this
    on Sep 9, 2026
  5. added
    in progress
    and removed
    in progress
    on Sep 10, 2026
  6. added a commit that references this issue on Sep 10, 2026
  7. robfrank commented on Sep 10, 2026

    @robfrank
    CollaboratorAuthor

    Fixed in #7397.

    The three search RPCs added by #7306 carried database and credentials but no TransactionContext, so a search issued while the client held an open gRPC transaction ran on a gRPC worker thread instead of the transaction's own thread and could not see that transaction's uncommitted writes. VectorSearchRequest, HybridSearchRequest and FullTextSearchRequest now carry an optional transaction, and the three handlers route through a shared helper that resolves it exactly as lookupByRid and updateRecord already do. RemoteGrpcDatabase stamps the open transaction on all three requests.

    Still open


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  8. removed
    in progress
    on Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementgrpcvector

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions