-
Notifications
You must be signed in to change notification settings - Fork 390
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
TransactionSerializationError
in UPDATE
concurrent queries
#7342
Comments
TransactionSerializationError
for select (update ...)
queries run concurrentlyTransactionSerializationError
for select (update ...)
concurrent queries
TransactionSerializationError
for select (update ...)
concurrent queriesTransactionSerializationError
in UPDATE
concurrent queries
I workaround this by using RwLock on client, so I can have select/insert/delete concurrent queries and sequential update queries. But I guess EdgeDB should handle it itself, as underlying postgres does? |
I think part of the reason for the difference with postgres is that we are using postgres's SERIALIZABLE isolation level, which is stricter than the default of READ COMMITTED. When I try it with postgres natively using SERIALIZABLE or REPEATABLE READ, I get the same results. Another part of this is that the CLI doesn't retry on fails, though I think all of our language clients do. |
My observation is completely opposite. I was getting this error on NodeJS separate workers and in multi-threaded Rust app too. I believe you're confusing it with Anyway, do you think retrying is correct way to workaround this? First time I tried to implement retries, and then I compared to RwLock implementation. I observed better results with manual locking on UPDATE operations. I guess receiving error and retrying multiple times is more expensive than synchronous locking. |
Hmmmm, I had thought that Doing synchronous locking should work great if you only have one client, but it doesn't help you in a distributed situation. |
|
Oh, good point. It looks like the rust bindings do reflect that faithfully: https://github.com/edgedb/edgedb-rust/blob/093729876737738a559e35c2ec3f0ae27efd2f69/edgedb-errors/src/kinds.rs#L139. This sort of counter workload is not a great fit for SERIALIZED/REPEATABLE READ, perhaps. |
@msullivan Can you double check js/py/go bindings? |
Is it possible to configure EdgeDB to work with postgres in |
I changed global and database |
EdgeDB sets the mode in the connection settings when it connects to postgres, I think. |
Steps to Reproduce:
insert A {}
Then, open two bash instances and run queries:
Observe errors:
errors.mp4
After end of loops,
A.value
will not reach 200.I got this also in JS and Rust client.
Compared to PostgresQL:
psql.mp4
The text was updated successfully, but these errors were encountered: