Database upgrade fails on servers with many jobs (probably over 65,535)
|Target version:||Milestone 9|
As I reported to Martchus and he confirmed today, it seems that the 56-57 schema migration (with current git master openQA code) fails on servers with a lot of jobs, with an error message that starts like this:
failed to run Perl in /usr/share/openqa/script/../dbicdh/_common/upgrade/56-57/001-migrate-jobs.pl: DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: number of parameters must be between 0 and 65535 [for Statement "SELECT me.job_id, me.result, COUNT( id ) FROM job_modules me WHERE ( job_id IN (
I can't paste the entire error message because it's huge - the next part is a huge list of question marks for some reason, then tens of thousands of job IDs. Martchus had this to say about it:
Indeed his suggestion worked: I made that edit to JobModules.pm, re-ran the upgrade, and it worked fine, and openQA has subsequently seemed to be working fine.
This is a significant issue as most production deployments are probably going to be affected by this, I would think.