diveangle
08/08/2025, 8:13 AMrelation_tuple, not counting any deleted ones, but at the moment only 680k of those that were written in the last day (so others will expire eventually), so maybe something in that ballpark would be how many relationships this process has to write once a day, and it takes around 20 minutes generally. Of course we also usually have concurrent usage of SpiceDB by our application for mostly CheckBulkPermissions requests whenever these syncs happen
Now with that context, we are seeing two types of errors in the spicedb pod logs, that I can confirm appear during these syncs, and I can reliably reproduce them by re-running the sync process. What is interesting is, the WriteRelationships calls on the sync process side seem to all succeed, which is why we didn't notice this error for some time (we didn't have alerts for the SpiceDB pod's errors so we didn't notice them). From our side it looked like the sync was succeeding, but we were not seeing some relationships that we thought we should be seeing (we were relying on the sync to create them in that case). Will split the rest of the message with the actual errors into a second message.diveangle
08/08/2025, 8:15 AM{"level":"error","err":"extended protocol limited to 65535 parameters","pid":773,"sql":"INSERT INTO relation_tuple (namespace,object_id,relation,userset_namespace,userset_object_id,userset_relation,caveat_name,caveat_context,expiration) VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9),($10,$11,$12,$13,$14,$15,$16,$17,$18),($19,$20,$21,$22,$23,$24,$25,$26,$27),($28,$29,$30,$31,$32,$33,$34,$35,$36),($37,$38,$39,$40,$41,$42,$43,$44,$45),($46,$47,$48,...","time":15.889214},"time":"2025-08-08T06:19:09Z","message":"Query"}
second
{
"level": "warn",
"lock_id": 1,
"message": "held lock not released; this likely indicates a bug"
}
Generally the first error occurs more often than the second, and sometimes I don't see the second, but usually we also get it.
We have SpiceDB configured to allow 10000 relationships as the batch size for WriteRelationships calls. Reducing the batch size to 5000 from the sync process's side caused the errors to go away completely. Could there be anything we're doing wrong or something we can do to solve this, so that we can put the batch size back to 10000 and there not be any issues with not seeing relationships that should have been inserted? Is it intended for an error like this to be possible when the WriteRelationships returned a success response?
Thanks in advance!Joey
08/08/2025, 8:24 AMJoey
08/08/2025, 8:24 AMJoey
08/08/2025, 8:24 AMJoey
08/08/2025, 8:27 AMdiveangle
08/08/2025, 8:40 AMJoey
08/08/2025, 8:41 AMJoey
08/08/2025, 8:41 AMJoey
08/08/2025, 8:41 AMJoey
08/08/2025, 8:41 AMJoey
08/08/2025, 8:43 AM(namespace,object_id,relation,userset_namespace,userset_object_id,userset_relation,caveat_name,caveat_context,expiration)diveangle
08/08/2025, 8:43 AMJoey
08/08/2025, 8:43 AMJoey
08/08/2025, 8:44 AMJoey
08/08/2025, 8:44 AMdiveangle
08/08/2025, 8:46 AMJoey
08/08/2025, 8:46 AMJoey
08/08/2025, 8:46 AMJoey
08/08/2025, 8:46 AMJoey
08/08/2025, 8:48 AMdiveangle
08/08/2025, 8:49 AMJoey
08/08/2025, 8:57 AMJoey
08/08/2025, 8:57 AMJoey
08/08/2025, 8:58 AMdiveangle
08/08/2025, 9:02 AMJoey
08/08/2025, 9:02 AMdiveangle
08/08/2025, 9:02 AMJoey
08/08/2025, 9:10 AMJoey
08/08/2025, 9:11 AMJoey
08/08/2025, 12:31 PM