Open bobvawter opened 3 years ago
@rafiss would the proposed solution in #61102 be able to help with this issue as well, if a user specified the timeout with deadline - now()?
Yes, seems like it would help, but it wouldn't be able to be configured per-transaction since the timeout in https://github.com/cockroachdb/cockroach/issues/61102 is being proposed as a session setting.
It would be useful to be able to set a deadline (absolute time) for a SQL transaction, as opposed to a timeout (relative time) discussed in #61102. The goal is to cover the case where a latency-sensitive application (<= 10ms) is connecting to a CRDB node which is unable to process an incoming
BEGIN
before the application has missed its SLA.A syntax such as
BEGIN TRANSACTION WITH DEADLINE <timestamp>
would allow the CRDB node to immediately return an error if the timestamp had already passed, perhaps due to CPU overload, network congestion, etc. A session variable likeSET transaction_deadline = <timestamp>
could also be used, which would apply to all subsequent transactions in the session.