Transaction BEGIN statements should use the query timeout rather than…#5238
Transaction BEGIN statements should use the query timeout rather than…#5238sougou merged 1 commit intovitessio:masterfrom
Conversation
e5e5049 to
bdfd194
Compare
|
I think you misunderstood: the tabletserver Basically, the SREs wanted a different timeout for this because applications want to fail fast if they're not able to begin a transaction, whereas a query can reasonably take longer to complete because it has to do more work accessing the necessary data. |
|
@sougou that makes sense. Previously, the
Thanks for pointing out (1) -- I missed that. The intention of this PR is to use the TxPoolTimeout solely for (1) and to use the query timeout for (2). |
5ad67c4 to
98394e2
Compare
sougou
left a comment
There was a problem hiding this comment.
I see what you're trying to do, and I like this approach. The improvement I'd suggest is to delete BeginTimeout and use QueryTimeout everywhere.
There was a problem hiding this comment.
Nice catch. We shoudl add a test for TransactionTimeout.
There was a problem hiding this comment.
And one for TxPoolTimeout here.
ab6fd20 to
9603130
Compare
When grabbing a connection from the transaction pool, we should use the queryserver-config-txpool-timeout. BEGIN statements should not use the queryserver-config-txpool-timeout when executing the BEGIN query. Signed-off-by: dleibovic <dleibovic@etsy.com>
… the transaction pool timeout. According to docs: "query server transaction pool timeout, it is how long vttablet waits if tx pool is full (default 1)". When we execute the BEGIN statment, we have already grabbed a connection from the transaction pool. Thus it does not make sense to use the transaction pool timeout here. Furthermore, this makes BEGIN behave more like COMMIT -- they will both use the query timeout now.
At Etsy, we have our TxPoolTimeout set relatively low (one second), whereas we have an unlimited query timeout. We were seeing timeouts occur here for the BEGIN statement:
vitess/go/vt/vttablet/tabletserver/connpool/dbconn.go
Line 140 in 5019c28
It's still an open question why one second was not enough (it should have been).