Sequences Broken in 7.1.1?

Moderator: NorbertKrupa

Post Reply
User avatar
janice
Intermediate
Intermediate
Posts: 51
Joined: Wed May 30, 2012 1:14 pm

Sequences Broken in 7.1.1?

Post by janice » Mon Mar 16, 2015 1:45 pm

Hello,

It seems to me that sequences are broken in 7.1.1.

Code: Select all

dbadmin=> \d test;
                                List of Fields by Tables
 Schema | Table | Column | Type | Size | Default | Not Null | Primary Key | Foreign Key
--------+-------+--------+------+------+---------+----------+-------------+-------------
 public | test  | col1   | int  |    8 |         | t        | t           |
(1 row)

dbadmin=> CREATE SEQUENCE test_seq;
CREATE SEQUENCE

dbadmin=> SELECT session_cache_count, increment_by, minimum, maximum, current_value FROM sequences WHERE sequence_name = 'test_seq';
 session_cache_count | increment_by | minimum |       maximum       | current_value
---------------------+--------------+---------+---------------------+---------------
              250000 |            1 |       1 | 9223372036854775807 |             0
(1 row)

dbadmin=> SELECT COUNT(*) FROM online_sales.online_sales_fact;
  COUNT
---------
 5000000
(1 row)

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
ERROR 4704:  Sequence exceeded max value

dbadmin=> SELECT session_cache_count, increment_by, minimum, maximum, current_value FROM sequences WHERE sequence_name = 'test_seq';
 session_cache_count | increment_by | minimum |       maximum       | current_value
---------------------+--------------+---------+---------------------+---------------
              250000 |            1 |       1 | 9223372036854775807 |       1500000
(1 row)
Why does it crap out at only 1,500,000 values? Is this a known issue? Or am I missing something here?
Everyday is an adventure!

User avatar
janice
Intermediate
Intermediate
Posts: 51
Joined: Wed May 30, 2012 1:14 pm

Re: Sequences Broken in 7.1.1?

Post by janice » Mon Mar 16, 2015 2:09 pm

If I set the CACHE to 10,000, I can insert 5,000,000 records once. But on a second run, the sequence exceeds it's max value...

Code: Select all

dbadmin=> CREATE SEQUENCE test_seq CACHE 10000;
CREATE SEQUENCE

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
 OUTPUT
---------
 5000000
(1 row)

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
ERROR 4704:  Sequence exceeded max value
Everyday is an adventure!

scutter
Master
Master
Posts: 302
Joined: Tue Aug 07, 2012 2:15 am

Re: Sequences Broken in 7.1.1?

Post by scutter » Mon Mar 16, 2015 6:20 pm

Hi Janice,

This was fixed in the 7.1.1-3 hot fix. Best to pick up the very latest hot fix.

—Sharon

VER-35924 Data load / COPY Bulk loading data using the COPY command sometimes resulted in sequence exceeded max value error. This issue has been resolved.
Sharon Cutter
Vertica Consultant, Zazz Technologies LLC

User avatar
janice
Intermediate
Intermediate
Posts: 51
Joined: Wed May 30, 2012 1:14 pm

Re: Sequences Broken in 7.1.1?

Post by janice » Mon Mar 16, 2015 6:52 pm

Thank you, Sharon. I just opened a case with Vertica to get the patch. I wonder how that bug got by QA :evil:
Everyday is an adventure!

User avatar
janice
Intermediate
Intermediate
Posts: 51
Joined: Wed May 30, 2012 1:14 pm

Re: Sequences Broken in 7.1.1?

Post by janice » Mon Mar 16, 2015 7:26 pm

I upgraded to 7.1.1-9 and now the sequence works as expected!

Code: Select all

dbadmin=> SELECT version();
              version
------------------------------------
 Vertica Analytic Database v7.1.1-9
(1 row)

dbadmin=> CREATE TABLE test (col1 INT);
CREATE TABLE

dbadmin=> CREATE SEQUENCE test_seq;
CREATE SEQUENCE

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
 OUTPUT
---------
 5000000
(1 row)

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
 OUTPUT
---------
 5000000
(1 row)

dbadmin=> INSERT INTO test SELECT test_seq.NEXTVAL FROM online_sales.online_sales_fact;
 OUTPUT
---------
 5000000
(1 row)
Cool!
Everyday is an adventure!

Post Reply

Return to “New to Vertica Database Administration”