element-hq / element-hq/synapse
check postgres sequences for validity on startup
Open
T-Enhancement
Z-Help-Wanted
z-p2
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 600
- Avg merge
- 5d 22h
- Merged PRs (30d)
- 51
Description
This issue has been migrated from [#7938](https://github.com/matrix-org/synapse/issues/7938).
---
in the last two weeks, I've seen two people who have migrated their databases to a new postgres instance and forgotten to copy the sequence generators. At best, this causes confusing errors; at worst, it could lead to corruption.
To save people from shooting themselves in the foot, we could check at startup that there are no rows in the table with IDs above the next number in the sequence, and refuse to start if so.
Contributor guide
Assessment
This issue has not been assessed yet.