mozilla/socorro — pull request #2360 by twobraids (2014-09-12 13:16:09+00:00)
Title: fixes Bug 1066316 - fix PG extension table insert for reprocessing jobs

during reprocessing of a crash, the extensions associated with a crash may already exist in the extensions table. The simple insert, unprotected by transaction checkpoints, will fail and derail the whole save to PG transaction.

this PR deletes the extensions data first then does the insert.

Why not check to see if there is data already there and then just not insert if data is there? We may be reprocessing to deal with missing extensions data, so just because there is already data there doesn't mean that we can skip this.

What about using "upsert" sql - that would be fine and result in one fewer round trip between client and database, but "upsert" sql is opaque and not easy to understand at a glance. This was faster to
implement.

What about using "transaction check points"? Too many round trips between the client and the server as each extension row insert would add two more client/server round trips.