Actions
Bug #4832
closedBug #4831: Reports cannot be inserted into postgresql due to a limit on ids
Add migration script about table ids
Status:
Released
Priority:
1 (highest)
Assignee:
Jonathan CLARKE
Category:
System integration
Target version:
Pull Request:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
Name check:
Fix check:
Regression:
Description
Since #4831, type of reports have changed from integer to bigint.
We will not migrate table automatically: it can take a very long time to perform and therefore could not fit in an automatic migration script.
We will provide a script available in /opt/rudder/... that will make the migration whenever the user is ok to run it.
In the migration process we will check if there is a still a table that needs migration and warn the user that there is something he can do!
there is 3 tables to look at : ruddersysevents (id), archivedruddersysevents (id), and statusUpdated (lastId)
The process to update reports table is more complicated:
- Ask if the user wish to keep all the previous reports or not
- if not keeping the previous reports, ask confirmation
- In a transaction:
- Rename table to old_table
- drop all indexes except the index on nodes
- create new "table" with bigint as id
- Outside the transaction:
- create new indexes on the new table
- If the user wish to keep all reports
- copy everything
- If the user does not wish to keep all reports
- copy latest 1000 reports of each node in the table
- the copy is node by node, with display of the amout of node copied, and reports are dropped each time a copy is made
- Drop "old_table"
- copy latest 1000 reports of each node in the table
Actions