You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
gRPC TimeSeriesQuery and TimeSeriesLatest cannot run inside a client transaction #7370
Found by the completeness sweep of #7326, which is the same gap on the three search RPCs.
TimeSeriesQueryRequest and TimeSeriesLatestRequest (added by #7305 / PR #7323) carry database and credentials but no TransactionContext, unlike ExecuteQueryRequest, LookupByRidRequest and - after #7326 - VectorSearchRequest. Both handlers resolve the database directly:
$ grep -n "public void timeSeries" -A 6 grpcw/src/main/java/com/arcadedb/server/grpc/ArcadeDbGrpcService.java
3400: public void timeSeriesQuery(...) -> getDatabase(...)
3631: public void timeSeriesLatest(...) -> getDatabase(req.getDatabase(), req.getCredentials())
So a client that opened a gRPC transaction, appended points through some other RPC in it and then queries the series reads outside its own transaction. POST/GET /api/v1/ts/{database}/... on the HTTP side runs through DatabaseAbstractHandler, which binds the session's transaction, so the two protocols disagree the same way #7326 describes.
Shape of the fix
Identical to #7326: add TransactionContext transaction to both request messages, resolve it with resolveAuthorizedTransaction, reject an unknown non-blank id with unknownTransactionStatus, run the body through submitToActiveTransaction, and stamp the open transaction on the request in RemoteGrpcDatabase. TimeSeriesQuery is server-streaming, so the streaming body needs the same treatment executeQueryStream already has rather than a plain unary submit.
Out of scope here
TimeSeriesWrite / TimeSeriesWriteStream are deliberately non-atomic - the proto documents that each measurement's batch commits its own shard transaction - so joining a caller's transaction is a separate design question, not the same bug.
Resolved by PR #7421 (not merged - the merge is yours).
Both RPCs now carry a TransactionContext, resolve it with resolveAuthorizedTransaction, refuse an unknown non-blank id with unknownTransactionStatus, and run the read on the transaction's own executor - readInTransaction (the generalized searchInTransaction from #7326) for TimeSeriesLatest, streamQuery's streaming dispatch for the server-streaming TimeSeriesQuery. RemoteGrpcDatabase stamps the open transaction on both.
Two premises in the issue turned out not to hold, and each is now pinned by a test rather than repeated:
A time-series append is not part of the enclosing transaction at all - TimeSeriesShard.appendSamples opens its own begin/commit, and an ArcadeDB nested transaction is an independent transaction rather than a savepoint, so the sample is durable and global before any commit and survives the rollback. Measured with a DOCUMENT row in the same transaction as the control. Filed as TimeSeries appends are not part of the enclosing transaction, and TimeSeriesEngine's javadoc says they are #7410, which also covers TimeSeriesEngine's javadoc claiming the opposite. Consequence: the fix changes where a time-series read runs, not which samples it sees.
What is left of the reported bug, and what this actually fixes, is the silent fall-through: a request naming a transaction the server no longer knows was read straight through instead of answering FAILED_PRECONDITION. Reverting only the server dispatch fails exactly the two tests that assert that, and no others.
TimeSeriesWrite/TimeSeriesWriteStream stay out of scope as the issue specifies; given #7410 that is the same fact stated at the RPC level.
TimeSeriesQuery and TimeSeriesLatest named a database and a caller, but carried no transaction, so both ran on a gRPC worker thread against a freshly resolved database handle - whatever transaction the caller believed it was inside. The visible symptom was the silent fall-through: a request naming a transaction the server no longer knew (reaped, committed, or never created) was answered as if nothing were wrong, where every other transaction-scoped RPC answers FAILED_PRECONDITION. Both requests now carry a TransactionContext, refuse an unknown non-blank id with that same status, and run the read on the transaction's own executor thread, so writes made inside a transaction are visible to a read issued inside it. The client stamps the connection's open transaction on both requests automatically.
Both are pinned by tests that fail when the behaviour changes, so neither can be closed silently.
❤️ 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.
Activity
robfrank commentedon Sep 10, 2026
Resolved by PR #7421 (not merged - the merge is yours).
Both RPCs now carry a
TransactionContext, resolve it withresolveAuthorizedTransaction, refuse an unknown non-blank id withunknownTransactionStatus, and run the read on the transaction's own executor -readInTransaction(the generalizedsearchInTransactionfrom #7326) forTimeSeriesLatest,streamQuery's streaming dispatch for the server-streamingTimeSeriesQuery.RemoteGrpcDatabasestamps the open transaction on both.Two premises in the issue turned out not to hold, and each is now pinned by a test rather than repeated:
TimeSeriesShard.appendSamplesopens its ownbegin/commit, and an ArcadeDB nested transaction is an independent transaction rather than a savepoint, so the sample is durable and global before any commit and survives the rollback. Measured with a DOCUMENT row in the same transaction as the control. Filed as TimeSeries appends are not part of the enclosing transaction, and TimeSeriesEngine's javadoc says they are #7410, which also coversTimeSeriesEngine's javadoc claiming the opposite. Consequence: the fix changes where a time-series read runs, not which samples it sees./api/v1/tsroutes do not bind the session transaction either - all three extendAbstractServerHttpHandler, notDatabaseAbstractHandler. Filed as HTTP /api/v1/ts read routes ignore arcadedb-session-id and read outside the session transaction #7402. So this closes the gap on gRPC and leaves gRPC strictly more transactional than HTTP here.What is left of the reported bug, and what this actually fixes, is the silent fall-through: a request naming a transaction the server no longer knows was read straight through instead of answering FAILED_PRECONDITION. Reverting only the server dispatch fails exactly the two tests that assert that, and no others.
TimeSeriesWrite/TimeSeriesWriteStreamstay out of scope as the issue specifies; given #7410 that is the same fact stated at the RPC level.fix(#7370): TimeSeriesQuery and TimeSeriesLatest run inside the calle…
Merge branch 'main' into fix/7394-low-severity-control-plane-grpc
robfrank commentedon Sep 11, 2026
Fixed in PR #7421, now merged.
TimeSeriesQueryandTimeSeriesLatestnamed a database and a caller, but carried no transaction, so both ran on a gRPC worker thread against a freshly resolved database handle - whatever transaction the caller believed it was inside. The visible symptom was the silent fall-through: a request naming a transaction the server no longer knew (reaped, committed, or never created) was answered as if nothing were wrong, where every other transaction-scoped RPC answersFAILED_PRECONDITION. Both requests now carry aTransactionContext, refuse an unknown non-blank id with that same status, and run the read on the transaction's own executor thread, so writes made inside a transaction are visible to a read issued inside it. The client stamps the connection's open transaction on both requests automatically.Still open
TimeSeriesEngine's javadoc claims the opposite. This also coversTimeSeriesWrite/TimeSeriesWriteStream, which still commit their own per-shard transactions./api/v1/tsread routes still ignorearcadedb-session-id, so for time series gRPC is now strictly more transactional than HTTP.Both are pinned by tests that fail when the behaviour changes, so neither can be closed silently.
❤️ 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.