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
|
|