Skip to content

search: migrate ids of worker tables from serial to bigserial

Warren Gifford requested to merge sh/cm/bigserial into main

Created by: stefanhengl

When I created the tables cm_trigger_jobs and cm_actions_jobs, which are used by workerutil to coordinate job execution, I defined the id columns as serial because workerutil operates with int as IDs and not int64. However, this should only ever make a difference if we wanted to support 32-bit systems.

Since we run queries frequently, it is conceivable that we run out of (serial) ids within a few years: Assuming we have a 1000 monitors that run once a minute, and with serial offering around 2 billion ids ...

2 * 10**9 / (1000 executions/minute * (60 * 24 * 365)minutes/year) = 3.8 years

This PR consists of 2 commits. The first commit migrates the tables from serial to bigserial. In principle, we could stop there, because the code would still work. However I think it is best to make the assumption explicit, so I replaced all occurrences of int with int64 in commit 2.

Merge request reports

Loading