Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1393170

Summary: Database Integrity Distro Library distro_activity
Product: [Retired] Beaker Reporter: Tyrone Abdy <tabdy>
Component: generalAssignee: Dan Callaghan <dcallagh>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: developCC: dcallagh, mjia, rjoost
Target Milestone: 25.0Keywords: Patch, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-03-19 04:18:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Tyrone Abdy 2016-11-09 03:18:24 UTC
Description of problem:

distro_activity can currently have distro_id nullable which would lead to orphaned activity items if a distro was deleted.

Within the migration script a deletion of orphaned data could be required as there was the possibility of it to happen.

Comment 1 Roman Joost 2016-12-13 23:48:23 UTC
Ideas:

* Change the column to be not nullable and run tests.
* Fix the fallout. Will probably need a migration script.

If it's too much, it's probably better to comment here.

Comment 2 Dan Callaghan 2017-12-20 05:15:54 UTC
Looking at a recent snapshot of our prod database:

MySQL [beaker_dcallagh]> select count(*) from distro_activity where distro_id is null;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.01 sec)

So I am confident we have not had any bugs in the past which have allowed distro rows to be deleted or distro_activity rows to become orphaned. Therefore I think we can safely make distro_activity.distro_id non-NULLable.

Comment 3 Dan Callaghan 2017-12-20 05:32:32 UTC
https://gerrit.beaker-project.org/5956

Comment 5 Dan Callaghan 2018-01-10 03:28:09 UTC
There is no expected change in behaviour here, so verification should just be that the database migration succeeds (it did) and that nothing else breaks.

Comment 7 Roman Joost 2018-03-19 04:18:41 UTC
Beaker 25.0 has been released.

Release notes are available upstream: https://beaker-project.org/docs/whats-new/release-25.html