Repository navigation
feat(server): report live activity and transaction conflicts (#573, first slice) - #583
Merged
Merged
Conversation
…irst slice) Operate could show health and Prometheus counters but not what the server is executing. Adds ManagementActivityRegistry (bounded, in-memory: active queries with session/database/user/160-char single-line SQL preview/elapsed, plus transaction conflicts with the holder named when identifiable), records the gRPC query path and the BeginTransaction FailedPrecondition branch, and exposes GET /api/v1/management/activity (admin only). Honest scope: no gRPC RPC yet, ExecuteNonQuery and the REST query paths are not instrumented, no durable history; the engine has one storage transaction per database so a lock wait IS a transaction conflict, and nothing invents queue positions. Docs: CHANGELOG, REST_API (Management: live activity), FEATURE_MATRIX. Tests: ManagementActivityTests (6), server suite 307/0.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ity snapshot (#573) The first slice only covered the gRPC ExecuteQuery path, so a write or a REST query never showed up in activeQueries. ExecuteNonQuery (gRPC), POST /api/v1/query and POST /api/v1/execute now open the same scope around the engine call, disposed with the request. CHANGELOG updated: the slice now covers reads and writes on both protocols; only the gRPC RPC for the snapshot itself remains out. Server suite 307/0.
|
This was referenced Dec 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



First slice of #573 (Operate: active queries, blocked sessions, lock waits), verified against the code first — the server had only health + Prometheus counters and no active-query tracking.
nnAddedn-ManagementActivityRegistry(in-memory, bounded, lossy): active queries (session, database, user, 160-char single-line SQL preview, started/elapsed) and transaction conflicts (a session refusedBeginTransactionwhile another holds the database storage transaction, holder named when identifiable). An entry exists only while the call executes; conflict queue keeps the last 50.n-GET /api/v1/management/activity(admin only) — documented in REST_API under Management: live activity.n- Recorded on the real paths:DatabaseService.ExecuteQuery(scope disposed with the call) and theBeginTransactionFailedPrecondition branch.nn**Deliberately not in this slice (so #573 stays open)**n- No gRPC RPC for the snapshot (a proto change plus a capability-contract entry).n-ExecuteNonQueryand the REST query paths are not instrumented yet.n- No durable history (that is #576) and no per-query plan/lock introspection — one storage transaction per database means a "lock wait" is a transaction conflict; no invented queue positions.nnTests:ManagementActivityTests(6 cases). Server suite 307/0 locally.