I was curious about the job_id parameter in AWX, in the postgresql database specifically. I tried to gather information on this myself and I believe I’ve arrived at the conclusion that job_id in the main_activitystream_job table is an integer numeric type, and so per PostgreSQL: Documentation: 16: 8.1. Numeric Types the highest job_id would be 2147483647.
If the job_id exceeds this, does anyone know what happens at 2147483648?
Just a theorical answer, as there might be some checks in AWX which might handle - or not - this situation.
That being said, postgresql whould throw an “integer out of range” error.
In theory, you could use an ‘alter table’ sql command to convert the column to bigint data type. But once again, we don’t know how AWX code woul deal with that and how existing data would be affected.
A client creating roughly 150000 jobs every month would, event at that rate, need more than 1100 years to exhaust the possible number of jobs ids. So I’m a bit afraid to ask if you think you could exhaust this range quickier ?
Nah, don’t think it’s likely, but just wanted to be sure since I see one of our instances is already around job ID 1.6 million. I’m not a huge Postgres guy, when you talk about a toast vacuum it makes me think of crumbs under the toaster in the kitchen, so I’m not exactly sure of what I’m seeing being correct. Appreciate the answer!
1.6 million is around 1/1000 of the available range for an integer (which is 2^31, as it’s signed).
Rewriting the table works, and unless AWX does also query the datatype, this will be transparent. But it will lock and rewrite the entire table. Downtime for AWX included.