Francisco Correia
03/01/2023, 6:04 PMspicedb migrate add-xid-constraints
step the following error:
[db-migration] {"level":"error","error":"unable to migrate to add-xid-constraints
revision: error executing migration `add-xid-constraints`: ERROR: index \"ix_relation_tuple_pk\" is not valid (SQLSTATE 55000)","time":"2023-03-01T17:57:45Z","message":"terminated with errors"}ecordell
03/01/2023, 7:26 PMFrancisco Correia
03/02/2023, 10:57 AMecordell
03/03/2023, 2:24 PMFrancisco Correia
03/07/2023, 2:00 PMecordell
03/07/2023, 2:46 PMFrancisco Correia
03/07/2023, 4:23 PM2023-03-07 16:21:50.218 GMT [12578] STATEMENT: ALTER TABLE relation_tuple
DROP CONSTRAINT pk_relation_tuple,
ADD CONSTRAINT pk_relation_tuple PRIMARY KEY USING INDEX ix_relation_tuple_pk,
ADD CONSTRAINT uq_relation_tuple_living_xid UNIQUE USING INDEX ix_relation_tuple_living;
2023-03-07 16:22:03.350 GMT [12609] ERROR: index "ix_relation_tuple_pk" is not valid at character 71
2023-03-07 23:16:52.770 GMT [4637] ERROR: deadlock detected
2023-03-07 23:16:52.770 GMT [4637] DETAIL: Process 4637 waits for ShareUpdateExclusiveLock on relation 16386 of database 16384; blocked by process 4640.
Process 4640 waits for ShareLock on virtual transaction 3/28975; blocked by process 4637.
Process 4637: CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS ix_rttx_oldpk
ON relation_tuple_transaction (id)
Process 4640: CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS ix_rttx_oldpk
ON relation_tuple_transaction (id)
2023-03-07 23:16:52.770 GMT [4637] HINT: See server log for query details.
2023-03-07 23:16:52.770 GMT [4637] STATEMENT: CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS ix_rttx_oldpk
ON relation_tuple_transaction (id)
On spiceDB:
[db-migration] {"level":"error","error":"unable to migrate to `add-xid-constraints` revision: error executing migration function: ERROR: deadlock detected (SQLSTATE 40P01)","time":"2023-03-07T23:16:52Z","message":"terminated with errors"}
But later:
[db-migration] {"level":"error","error":"unable to migrate to `add-xid-constraints` revision: error executing migration `add-xid-constraints`: ERROR: index \"ix_relation_tuple_pk\" is not valid (SQLSTATE 55000)","time":"2023-03-07T23:17:01Z","message":"terminated with errors"}
Do you have suggestions for how to run these migrations to avoid these issues? And could the problem be coming from somewhere else?ecordell
03/08/2023, 2:41 PMFrancisco Correia
03/10/2023, 12:12 AM