#Database Max Retries

1 messages · Page 1 of 1 (latest)

latent socket
#

Hello @wanton sluice , which version of Permify are you using?

wanton sluice
#

v0.5.8

latent socket
#

Can you try again using v0.6.2? Also, the issue of providing JSON output for the logger is available in this release. You can use it by writing log-output=json to the environment variable or the config file if you wish. The documentation can be found at 'https://docs.permify.co/docs/reference/configuration/'

wanton sluice
#

Is 0.6.3 also good ?

latent socket
#

Yes, I wrote it wrong, it's v0.6.3

wanton sluice
#

This helped in the performance but I still get a lot of this kind of errors

Failed to write data to the database. Max retries reached. Aborting operation.

#

Also this

Error encountered

latent socket
#

Can you tell me approximately how many writing processes you have done? And do you send each relationship in separate requests?

wanton sluice
#

No, we send multiple relationships in each request and multiple requests together. Here is my current configuration.

Amount of parallel gRPC requests: 20
Amount of tuples inside each request: 20
Amount of operations: 25000

#

The whole process is taking approximatively 15 minutes.

#

~ 30 requests/second

latent socket
#

In PostgreSQL database, we perform write operations at the Serializable isolation level to avoid any inconsistencies. The error you are encountering occurs in two main scenarios: Firstly, it happens when a transaction makes decisions based on the outcomes of another transaction, and these outcomes change, leading to a conflict. Secondly, it arises when two transactions try to modify the same data simultaneously. As a result, the system attempts to retry the transaction. The retry limit is set to 10. The error message you are receiving indicates that this retry limit has been exceeded.

#

I will consult with my team and get back to you as soon as possible with a better solution. If this is a one-time operation and you do not expect such a high volume of write requests in production, you could consider performing write operations at specific intervals. I will follow up with you shortly.

wanton sluice
#

Okay thank you

latent socket
#

Hello @wanton sluice , Thanks for your patience. I've discussed with my team and we are ready to make an optimization. Can you open this as an issue? We will include this optimization in this quarter's developments.

wanton sluice
latent socket
#

yes

latent socket
#

Hello @wanton sluice , we implemented a backoff strategy in version 0.7.1 to address the issue with the writes. Could you please test it again and inform us about the results?

wanton sluice
#

Hi @latent socket , we have released v0.6 already and I will upgrade it next week
Let you know with that
Thank you for the follow up