Closed ww-daniel-mora closed 5 months ago
I see this error is already handled with backoff. I wonder if we could just lock the roles table for each role modification.
// Custom error filter, mainly to retry role creation.
// Frequently see "tuple concurrently updated", and adding
// dependencies is very hard to make work.
const errorFilter = (error: any) => {
// Retry only if the error message contains "tuple concurrently updated"
return error.message.includes("tuple concurrently updated")
}
You can try to add some dependencies, although I myself haven't had much luck with those, as I easily get circular dependencies.
And not sure what tables you need to lock honestly, we use a postgresql command, I don't think it's documented.
Did you try this with version 3.2? I just released that as I had the same issue. There are some other options too:
Or maybe we I need to rethink the whole approach, and role creation must be sequential, i.e. done at once instead of in parallel as right now.
I'll updated to the latest.
I did a bit of looking around and found this discussion on reliably dropping a role which I attempted to implement in #23 .
I also came across a concurrent delete error so expanded the error filter and added logging and doubled the retry. I see the pr check is failing so I will investigate that as well.
Will marked this as resolved with the addition of rollback. That should enable users to undo permissions changes.
Role creation sometimes fails with the
Tuple concurrently updated
. A retry mechanism might be sufficient.