Mix of explicit event definition IDs and CURRVAL results in unhappiness

Bug #957453 reported by Dan Scott
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Critical
Thomas Berezansky

Bug Description

* Evergreen master
* PostgreSQL 9.1

I noticed when creating the database schema today that my PostgreSQL log contained the following:

ERROR: insert or update on table "event_params" violates foreign key constraint "event_params_event_def_fkey"
DETAIL: Key (event_def)=(100) is not present in table "event_definition".
STATEMENT: INSERT INTO action_trigger.event_params (event_def, param, value)
            VALUES (currval('action_trigger.event_definition_id_seq'), 'check_email_notify', 1);

This is because at line 7213 we use SETVAL to set the sequence value to 100.

But that breaks later, down on line 9212, when we use an explicit ID to create the event definition, but fall back to using CURRVAL on the sequence.

Tags: bitesize
Dan Scott (denials)
Changed in evergreen:
milestone: none → 2.2.0beta1
Revision history for this message
Dan Scott (denials) wrote :

Marked as "Critical" because it should be a release blocker.

Changed in evergreen:
importance: Undecided → Critical
Dan Scott (denials)
tags: added: bitesize
Revision history for this message
Dan Scott (denials) wrote :

Pushed a fix to user/dbs/lp957453_fix_stock_schema in working - simply using the explicit ID for the row instead of relying on CURRVAL. This should be applied to both master and rel_2_2.

Changed in evergreen:
assignee: nobody → Thomas Berezansky (tsbere)
Dan Scott (denials)
Changed in evergreen:
milestone: 2.2.0beta1 → 2.2.0beta2
Revision history for this message
Thomas Berezansky (tsbere) wrote :

Pushed, yay!

Changed in evergreen:
milestone: 2.2.0beta2 → 2.2.0beta1
status: New → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.