Add a "long query" timeout
- Dominant language
- Go
- Stars
- 30.1k
- Forks
- 4.6k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 39
Description
#1278 and especially https://github.com/hashicorp/vault/issues/679#issuecomment-157175674 got me thinking that it would be nice to have a long query timeout, especially on write transactions to the state store where the writer holds a lock and blocks all other writers.
We can't use an actual timeout because that would not be deterministic among all the servers, but if we implemented an "operation count" that simply counted the number of inserts, firsts, or gets (with a little help from memdb, accumulating a counter inside the transaction) we could set an upper limit and make the long-running write operation time out and abort the transaction in a deterministic way. We could apply the same thing to reads, although they are less disruptive since there can be many concurrent readers.
Contributor guide
Research direction
Start with the state-store transaction and memdb integration described in the issue, then review how inserts, firsts, and gets are counted. Define a deterministic operation-count limit for long-running transactions and determine how exceeding it should abort writes, with reads considered separately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- databases, distributed-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100