Hi All,
# spicedb
f
Hi All, We’ve had issues upgrading our SpiceDB instance since we’ve started replicating our postgres database into BigQuery. Our migrations fail due to not being able to update the
alembic_version
table while we’re publishing updates.
ERROR: cannot update table \"alembic_version\" because it does not have a replica identity and publishes updates (SQLSTATE 55000)
. We’ve identified some solutions, either setting replica identity to full for
alembic_version
, or stopping publishing this table, with the second option looking favourable as we didn’t want to alter the spicedb schema. However we still wanted to ask whether there’s a reason that
alembic_version
doesn’t have a primary key, and have you encountered this problem before?
v
👋 I don't know what was the reason not to add a primary key on that table. I can only speculate it's because that table is only meant to have 1 row at a time and was deemed as unnecessary. I've observed somewhat similar problems when GitHub implemented the MySQL datastore implementation. In that datastore you can see a primary key was added to deal with
gh-ost
design choices: https://github.com/authzed/spicedb/blob/334c7493f20c32975a58021c875943e42219f7f5/internal/datastore/mysql/migrations/zz_migration.0001_initial_schema.go#L6-L8
@Jake do you happen to know anything the decision of not adding a PK to
alembic_version
on the PG datastore?
j
It should be noted that replicas of any kind are not supported by SpiceDB without hacks
so if you are using some sort of replica (read or even worse, writes), it will fail in spectacular ways
If it is only for backup purposes, that should be okay
j
It is historical and dates back to when we actually used the alembic software on the python version. This was the schema that it lays down.
f
The replication is just to backup the data into our data warehouse.
t
@corkrean here the thread for reference 😄
7 Views