Bug #38497
closedERROR: nextval: reached maximum value of sequence "katello_erratum_packages_id_seq" during concurrent repository sync plan executions
Description
ERROR: nextval: reached maximum value of sequence "katello_erratum_packages_id_seq" during concurrent repository sync plan executions
Cloned from 17022692
Under certain conditions, Katello may show the following error i.e.
ERROR: nextval: reached maximum value of sequence "katello_erratum_packages_id_seq" (2147483647)
when trying to sync too many repos ( initiating several sync plans at once ) at once. Perhaps too many erratas were being synced into Katello and that has reached the maximum value set for katello_erratum_packages_id_seq sequence related to katello_erratum_packages table in foreman\katello.
We have fixed a similar bug for katello_repository_rpms_id_seq by changing it's data type to bigint via [https://issues.redhat.com/browse/SAT-25756] in Sat 6.15.2+ . Perhaps we need to do the same for katello_erratum_packages_id_seq as well.
NOTE: Once it happens, this is a blocker for that user and he\she cannot perform any further repo sync tasks successfully.
And some outputs from postgres about the issue:
{code:java}- su - postgres
c "psql foreman"------------------------------------------------+-----------+-------------+-----------+------------+--------------+-------+------------+------------
psql (12.22)
Type "help" for help.
foreman=# select * from pg_sequences where sequencename='katello_erratum_packages_id_seq';
schemaname | sequencename | sequenceowner | data_type | start_value | min_value | max_value | increment_by | cycle | cache_size | last_value
-----------
public | katello_erratum_packages_id_seq | foreman | integer | 1 | 1 | 2147483647 | 1 | f | 1 | 2147483647
(1 row)
foreman=# \d+ katello_erratum_packages_id_seq
Sequence "public.katello_erratum_packages_id_seq"
Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
---------+-------+---------+------------+-----------+---------+-------
integer | 1 | 1 | 2147483647 | 1 | no | 1
Owned by: public.katello_erratum_packages.id
foreman=# \d+ katello_erratum_packages
Table "public.katello_erratum_packages"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
------------+------------------------+-----------+----------+------------------------------------------------------+----------+--------------+-------------
id | integer | | not null | nextval('katello_erratum_packages_id_seq'::regclass) | plain | |
erratum_id | integer | | not null | | plain | |
nvrea | character varying(255) | | not null | | extended | |
name | character varying(255) | | not null | | extended | |
filename | character varying(255) | | | | extended | |
Indexes:
"katello_erratum_packages_pkey" PRIMARY KEY, btree (id)
"katello_erratum_packages_eid_nvrea_n_f" UNIQUE, btree (erratum_id, nvrea, name, filename)
"index_katello_erratum_packages_on_erratum_id_and_nvrea" btree (erratum_id, nvrea)
Foreign-key constraints:
"katello_erratum_packages_errata_id_fk" FOREIGN KEY (erratum_id) REFERENCES katello_errata(id)
Referenced by:
TABLE "katello_module_stream_erratum_packages" CONSTRAINT "katello_msep_erratum_package_id_fk" FOREIGN KEY (erratum_package_id) REFERENCES katello_erratum_packages(id)
Access method: heap
{code}
Updated by Ian Ballou 9 days ago
- Category set to Repositories
- Assignee set to Ian Ballou
- Target version changed from Katello Next to Katello 4.18.0
Updated by The Foreman Bot 9 days ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/Katello/katello/pull/11419 added
Updated by Anonymous 5 days ago
- Status changed from Ready For Testing to Closed
Applied in changeset katello|63f5f434596e5bb6087da39a4ea8b649789428bf.