Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speculative: Run transaction rollback asynchronously #59

Open
josephschorr opened this issue Sep 2, 2021 · 1 comment · May be fixed by #2096
Open

Speculative: Run transaction rollback asynchronously #59

josephschorr opened this issue Sep 2, 2021 · 1 comment · May be fixed by #2096
Labels
area/datastore Affects the storage system priority/4 maybe This might get done someday state/needs discussion This can't be worked on yet

Comments

@josephschorr
Copy link
Member

Right now, the transaction used in the CRDB driver to set the query to use the proper time is rolled back synchronously via a defer tx.Rollback(ctx) call in the query code: https://github.com/authzed/spicedb/blob/main/internal/datastore/common/sql.go#L248

During performance testing it was noticed that this rollback can take anywhere from 0.5ms to 3ms, so it might be possible to get a small win if we can run the rollback asynchronously while the queried data is returned to the caller. This may not be possible given the connection pool in use; we'd need to investigate if this would cause any secondary effects.

@josephschorr josephschorr added priority/4 maybe This might get done someday area/datastore Affects the storage system state/needs discussion This can't be worked on yet labels Sep 2, 2021
@ecordell
Copy link
Contributor

ecordell commented Sep 2, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datastore Affects the storage system priority/4 maybe This might get done someday state/needs discussion This can't be worked on yet
Projects
None yet
2 participants