Xid8 type in postgres
# spicedb
p
Hello, I see when using PostgreSQL the schema is using the
xid8
type. How does this type play with a full server backup & restore? What happens if you've generated transaction IDs to the limit of that type?? 🤔
v
Assuming that xid8 resets again, it should be fine. The implementation does not require it to be monotonically increasing, and mist likely the GC would remove old revisions by the time the data type reset.
If you refer to restore using "zed", that data type is not backed up and irrelevant to the process, is used just as it is under any other normal transaction
If you are doing pg_dump and pg_restore, then it is an issue. That's why we developed "spicedb datastore repair" command.
more information, from the Postgres docs. The answer is that it's strictly monotonically increasing. >Another identifier type used by the system is xid, or transaction (abbreviated xact) identifier. This is the data type of the system columns xmin and xmax. Transaction identifiers are 32-bit quantities. In some contexts, a 64-bit variant xid8 is used. Unlike xid values, xid8 values increase strictly monotonically and cannot be reused in the lifetime of a database cluster. See Section 74.1 for more details.
you can read more about transaction Ids here: https://www.postgresql.org/docs/current/transaction-id.html