Jira (PDB-4675) Deadlock when creating/inserting into a new report partition

0 views
Skip to first unread message

Austin Blatt (Jira)

unread,
Mar 18, 2020, 5:23:04 PM3/18/20
to puppe...@googlegroups.com
Austin Blatt created an issue
 
PuppetDB / Bug PDB-4675
Deadlock when creating/inserting into a new report partition
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/03/18 2:22 PM
Priority: Normal Normal
Reporter: Austin Blatt

When PuppetDB has to create a new partition the creation and insertion happen in different transactions and some of the constraints can deadlock with the insertion

< 2020-03-18 10:01:23.195 PDT > ERROR:  deadlock detected at character 13
< 2020-03-18 10:01:23.195 PDT > DETAIL:  Process 71527 waits for RowExclusiveLock on relation 17910 of database 16387; blocked by process 71529.
        Process 71529 waits for ShareRowExclusiveLock on relation 17910 of database 16387; blocked by process 71527.
        Process 71527: INSERT INTO reports_20200318Z ( status_id, environment_id, catalog_uuid, receive_time, hash, transaction_uuid, puppet_version, noop, logs, report_format, start_time, producer_timestamp, cached_catalog_status, end_time, producer_id, configuration_version, code_id, noop_pending, certname, metrics, job_id ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 )
        RETURNING *
        Process 71529: DO $$ BEGIN BEGIN ALTER TABLE ONLY reports_20200318Z ADD CONSTRAINT reports_certname_fkey_20200318Z
                       FOREIGN KEY (certname) REFERENCES certnames(certname) ON DELETE CASCADE; EXCEPTION WHEN duplicate_object THEN RETURN; END; END $$
< 2020-03-18 10:01:23.195 PDT > HINT:  See server log for query details.
< 2020-03-18 10:01:23.195 PDT > STATEMENT:  INSERT INTO reports_20200318Z ( status_id, environment_id, catalog_uuid, receive_time, hash, transaction_uuid, puppet_version, noop, logs, report_format, start_time, producer_timestamp, cached_catalog_status, end_time, producer_id, configuration_version, code_id, noop_pending, certname, metrics, job_id ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 )
        RETURNING *
< 2020-03-18 10:01:23.201 PDT > ERROR:  deadlock detected
< 2020-03-18 10:01:23.201 PDT > DETAIL:  Process 71520 waits for ShareRowExclusiveLock on relation 17910 of database 16387; blocked by process 71529.
        Process 71529 waits for RowExclusiveLock on relation 17910 of database 16387; blocked by process 71520.
        Process 71520: DO $$ BEGIN BEGIN ALTER TABLE ONLY reports_20200318Z ADD CONSTRAINT reports_certname_fkey_20200318Z
                       FOREIGN KEY (certname) REFERENCES certnames(certname) ON DELETE CASCADE; EXCEPTION WHEN duplicate_object THEN RETURN; END; END $$
        Process 71529: INSERT INTO reports_20200318Z ( status_id, environment_id, catalog_uuid, receive_time, hash, transaction_uuid, puppet_version, noop, logs, report_format, start_time, producer_timestamp, cached_catalog_status, end_time, producer_id, configuration_version, code_id, noop_pending, certname, metrics, job_id ) VALUES ( $1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21 )
        RETURNING *
< 2020-03-18 10:01:23.201 PDT > HINT:  See server log for query details.
< 2020-03-18 10:01:23.201 PDT > CONTEXT:  SQL statement "ALTER TABLE ONLY reports_20200318Z ADD CONSTRAINT reports_certname_fkey_20200318Z
                       FOREIGN KEY (certname) REFERENCES certnames(certname) ON DELETE CASCADE"
        PL/pgSQL function inline_code_block line 1 at SQL statement

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Nick Burgan (Jira)

unread,
Mar 25, 2020, 2:10:04 PM3/25/20
to puppe...@googlegroups.com

Nick Burgan (Jira)

unread,
Mar 25, 2020, 2:10:05 PM3/25/20
to puppe...@googlegroups.com

Austin Blatt (Jira)

unread,
Mar 27, 2020, 12:48:03 PM3/27/20
to puppe...@googlegroups.com

Nick Burgan (Jira)

unread,
Apr 8, 2020, 2:24:03 PM4/8/20
to puppe...@googlegroups.com
Nick Burgan updated an issue
Change By: Nick Burgan
Sprint: HA Team 2020-04-08 , HA Team 2020-04-22 (SS 4/15)

Nick Burgan (Jira)

unread,
Apr 8, 2020, 2:28:04 PM4/8/20
to puppe...@googlegroups.com

Austin Boyd (Jira)

unread,
Aug 18, 2020, 10:01:08 AM8/18/20
to puppe...@googlegroups.com

Austin Boyd (Jira)

unread,
Aug 18, 2020, 10:05:04 AM8/18/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 39812

Austin Boyd (Jira)

unread,
Sep 17, 2020, 5:29:04 AM9/17/20
to puppe...@googlegroups.com
Austin Boyd updated an issue
Change By: Austin Boyd
Zendesk Ticket Count: 1 2
Zendesk Ticket IDs: 39812 ,39963
Reply all
Reply to author
Forward
0 new messages