Closed Bug 1681473 Opened 4 years ago Closed 4 years ago

Cannot expire multicommit data points

Categories

(Tree Management :: Perfherder, defect, P1)

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: igoldan, Assigned: igoldan)

References

(Regression)

Details

Attachments

(1 file, 1 obsolete file)

Sarah Clements pointed out we have this error showing up on treeherder-prototype:

Failed to delete performance data chunk: (Exception: (1451, 'Cannot delete or update a parent row: a foreign key constraint fails (`treeherder`.`perf_multicommitdatum`, CONSTRAINT `perf_multicommitdatu_perf_datum_id_c2d7eb14_fk_performan` FOREIGN KEY (`perf_datum_id`) REFERENCES `performance_datum` (`ID`))'))

Looking closer on Papertrail, I can see it reproduces identically on all our environments, including production.

Most likely, this bug was added during the multicommit ingestion feature (namely bug 1654496).

It seems like when we're deleting multicommit data points from performance_datum table, the process somehow stumbles upon the perf_multicommitdatum table.

perf_multicommitdatum is a temporary table we added just to be able to revert the feature, in case we found it buggy in the 1st month. Approximately 2 months have passed since.

Assuming it is still working ok, we should also consider removing this table.

Jira issue: https://jira.mozilla.com/browse/FXP-1430

Regressed by: 1654496

Doing a bit of research, I came across this SO thread. Turns out Django's on_delete=models.CASCADE is not setup at SQL database level (when the migration is done). It's only kept at Django's ORM level. This can explain the unexpected behavior.

Still, one would expect Django's models.Model.delete() should still handle this...

Assignee: nobody → igoldan
Severity: -- → S3
Priority: P3 → P1
Attachment #9192568 - Attachment is obsolete: true
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: