Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix contract_tpid_fkey-related race condition #11330

Merged
merged 8 commits into from
Oct 22, 2021
Prev Previous commit
Next Next commit
successfully reproduce the error pre-4633c3137a
- Batch entry 0
        INSERT INTO some_fancy_prefix_contract
        VALUES ('foo', 1, 'null'::jsonb, NULL, '{}'::jsonb, ?, ?, '')
        ON CONFLICT (contract_id) DO NOTHING
       was aborted: ERROR: insert or update on table "some_fancy_prefix_contract" violates foreign key constraint "some_fancy_prefix_contract_tpid_fkey"
  Detail: Key (tpid)=(1) is not present in table "some_fancy_prefix_template_id".
  • Loading branch information
S11001001 committed Oct 21, 2021
commit 63c3820e0a6900fb0d82e89ce609b6663ae6f5f0
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ abstract class AbstractDatabaseIntegrationTest extends AsyncFreeSpecLike with Be
for {
_ <- queries.dropAllTablesIfExist
_ <- queries.initDatabase
_ <- fconn.commit
_ <- stid
_ <- fconn.rollback // as with when we conflict and retry
tpid <- stid
Expand Down