hello. We have copied our postgress db
# spicedb
y
hello. We have copied our postgress db to new one and used it for spice db. After it we receive "unexpected consistency middleware error" errors, how can i fix it? i tried to restart spicedb app, tried to update schema, but it didnt help(
should i run spicedb datastore repair ?
y
yeah, that's where i would start. what was the mechanism you used to copy the DB?
y
i used percona but command didn't help)
all started to be ok after ~3 hours, without any changes, commands, etc
i noticed {"level":"error","requestID":"81ac297e-dfc4-4d9f-a8fe-945808adb953","error":"context canceled","time":"2025-07-07T10:03:26Z","message":"unexpected consistency middleware error"} and this query SELECT namespace, object_id, relation, userset_namespace, userset_object_id, userset_relation, caveat_name, caveat_context FROM relation_tuple WHERE pg_visible_in_snapshot(created_xid, $1) = $2 AND pg_visible_in_snapshot(deleted_xid, $3) = $4 AND namespace = $5 AND relation = $6 AND object_id IN ($7) AND ((userset_namespace = $8 AND userset_object_id IN ($9) AND userset_relation = $10)) loaded my db CPU up to 100
y
i'm not familiar with percona. is it doing a dump/restore?
also are you running any other workloads on the same database?
y
yes, i didn't stop requests to spice db, i had a lot of requests percona doing backup "on run"
y
if it's using
pg_dump
and
pg_restore
under the hood, then yes, that's going to cause problems
and we generally recommend putting SpiceDB into read-only mode before doing data migrations between datastores
it doesn't surprise me that trying to do an online migration resulted in weird behavior