Project

General

Profile

Actions

Bug #38497

closed

ERROR: nextval: reached maximum value of sequence "katello_erratum_packages_id_seq" during concurrent repository sync plan executions

Added by Ian Ballou 10 days ago. Updated 5 days ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Repositories
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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}
  1. 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}
     
Actions

Also available in: Atom PDF