Database primary key reached maximum value of sequence #5501
Labels
help wanted
Issues with this label are ready to start work but are in need of someone to do it
priority/backlog
Issue is approved and in the backlog
What happened
Our psql raised the "error reached maximum value of sequence" by
node_resolver_map_entries_id_seq
. And server down.We have a large amount of agents. and some of the agents we deploy are constantly restarting,
Why
spire/pkg/server/datastore/sqlstore/models.go
Line 10 in 3d158ce
It is seems that the
ID
field innode_resolver_map_entries
is not enough in such scenarios.SPIRE, which uses gorm v1, will mapping the
uint
toint
type in DB anduint64
tobigint
(By the way, gorm v2 will mapping bothuint
anduint64
tobigint
).Each agent restarting (or attestation) will increase the
node_resolver_map_entries_id_seq
value.What to do
Modify the type? Use uint64 in Model primary key.
I'm worried about the DDL modification in the migration, for a large table, the type modification will lock the whole table and the server will down.
The text was updated successfully, but these errors were encountered: