Bug #37403
closedContent view publish failing with katello_repository_rpms_id_seq reached maximum value error
Description
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=2278566
Description of problem:
Unable to publish the content view due to limitation of katello_repository_rpms_id_seq because it is set as integer type. The "id" column of the table "katello_repository_rpms" is set as bigint however, the sequence "katello_repository_rpms_id_seq" is set as Integer. Therefore, the sequence limit to max integer value +2,147,483,647. When this limit reaches, CU can not publish/promote content view with this below error:
~~
PG::SequenceGeneratorLimitExceeded: ERROR: nextval: reached maximum value of sequence "katello_repository_rpms_id_seq" (2147483647)
~~
Version-Release number of selected component (if applicable):
Any version
How reproducible:
100%
Actual results:
CV publish failing with the maximum value reached error.
Expected results:
CV publish should be successful
Additional info:
- \d katello_repository_rpms;
Table "public.katello_repository_rpms"
Column | Type | Collation | Nullable | Default
---------------+-----------------------------+-----------+----------+-----------------------------------------------------
id | bigint | | not null | nextval('katello_repository_rpms_id_seq'::regclass). <===========
rpm_id | integer | | not null |
repository_id | integer | | |
created_at | timestamp without time zone | | |
updated_at | timestamp without time zone | | |
- \d katello_repository_rpms_id_seq;'"
Sequence "public.katello_repository_rpms_id_seq"
Type | Start | Minimum | Maximum | Increment | Cycles? | Cache
---------+-------+---------+------------+-----------+---------+-------
integer | 1 | 1 | 2147483647 | 1 | no | 1
- select * from pg_sequences where sequencename='katello_repository_rpms_id_seq';
schemaname | sequencename | sequenceowner | data_type | start_value | min_value | max_value | increment_by | cycle | cache_size | last_value
------------+--------------------------------+---------------+-----------+-------------+-----------+------------+--------------+-------+------------+-----------
-
public | katello_repository_rpms_id_seq | foreman | integer | 1 | 1 | 2147483647 | 1 | f | 1 | 2147483647
(1 row)