Closed Bug 1066316 Opened 10 years ago Closed 10 years ago

upsert code fails to upsert foreign key tables

Categories

(Socorro :: Database, task)

x86_64
Linux
task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: lars, Unassigned)

Details

the postgres crashstorage class has been changed to use an "upsert" instead of "delete cascade; insert". The "upsert" was not extended to the dependent tables with foreign keys. Unfortunately, this means that in reprocessing, inserts into both/either the 'extension' and 'plugin_reports' tables will result in IntergrityErrors as duplicate records are attempted to be inserted. The previous system used "delete cascade" to ensure this situation didn't happen. With the "delete cascade" gone, the transaction of saving a processed crash is derailed and fails. solution: extend the upsert code to the 'extension' and 'plugin_reports' tables.
Commit pushed to master at https://github.com/mozilla/socorro https://github.com/mozilla/socorro/commit/1b9caba80065c2a6906109e32e0e7a7891d45481 Merge pull request #2360 from twobraids/clearer-than-upsert fixes Bug 1066316 - fix PG extension table insert for reprocessing jobs
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
the associated PR only did half the problem - the extensions table is fine, but plugins still has the problem
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Commit pushed to master at https://github.com/mozilla/socorro https://github.com/mozilla/socorro/commit/1c03ad5a26b4d3015fc2ffa46c931a20ae57c329 Merge pull request #2362 from twobraids/fix-plugins-integrity-error fixes Bug 1066316 - make sure plugins_reports_* is properly cleared before replacing a row
Status: REOPENED → RESOLVED
Closed: 10 years ago10 years ago
Resolution: --- → FIXED
Target Milestone: --- → 102
You need to log in before you can comment on or make changes to this bug.