jhleao
07/31/2023, 11:16 PMauthzed/spicedb dockerhub image for local development. Using Postgres as the storage engine. All seems to run fine. spicedb migrate head is being ran before spicedb serve, the grpc PSK is properly set up, the instance is able to connect to Postgres, and our apps can talk to spicedb. We're able to write schema, relations and query permissions.
Though, intermittenlty, as a response for WriteRelationships, I've been getting the following:
2 UNKNOWN: unable to write relationships: ERROR: current transaction is aborted, commands ignored until end of transaction block (SQLSTATE 25P02)
and
2 UNKNOWN: max retries exceeded: ERROR: could not serialize access due to read/write dependencies among transactions (SQLSTATE 40001)
and sometimes this
2 UNKNOWN: commit unexpectedly resulted in rollback
This seems to come from pgx. I did test running spicedb on memory persistance and this does not happen.
I tried severely throttling my write throughput to see if it's something to do with concurrency. Turns out running more than one concurrent WriteRelationships is causing this. Running one write at a time works fine. Though this isn't realistic for us.
Running two at time works ~50% of the time. Running three or more always throws one of these errors.
I've also tried changing our read consistency levels around but that had no effect. Also tried rolling back a few spicedb versions. No luck..
Any ideas? Thanks in advance