Bug 1404054

Summary: beakerd runs all data migrations unnecessarily on an empty, freshly created database
Product: [Retired] Beaker Reporter: Dan Callaghan <dcallagh>
Component: generalAssignee: matt jia <mjia>
Status: CLOSED CURRENTRELEASE QA Contact: tools-bugs <tools-bugs>
Severity: low Docs Contact:
Priority: unspecified    
Version: 23CC: dcallagh, mjia, rjoost, tabdy
Target Milestone: 24.2Keywords: EasyFix, 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: 2017-03-30 03:23:01 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 Dan Callaghan 2016-12-13 00:05:55 UTC
Version-Release number of selected component (if applicable):
23.3

How reproducible:
with a fresh install

Steps to Reproduce:
1. Make a fresh Beaker installation, or at least start from an empty database populated by beaker-init
2. Start beakerd
3. Look in the beakerd logs

Actual results:
[...]
Dec 13 09:57:02 belljar.usersys.redhat.com beakerd[18100]: bkr.server.tools.beakerd DEBUG Incomplete data migrations will be run: commands-for-recipe-installations
[...]

Expected results:
There should be no reason to bother doing this data migrations, there is nothing to migrate.

Additional info:
The migration itself is harmless and takes no time when the database is empty, but it creates extra noise and looks strange. beaker-init should just mark all known migrations as already-completed when it is populating a new database from scratch, so that they are not attempted.

Comment 1 matt jia 2017-02-07 06:10:13 UTC
On Gerrit:
   
    https://gerrit.beaker-project.org/#/c/5601/

Comment 2 Roman Joost 2017-03-06 23:56:51 UTC
We'll have to do QE on the items before we can tag a release.

Comment 3 Roman Joost 2017-03-14 05:55:56 UTC
Tested on my own beaker installation (Beaker 24.2.git.9.d4c983d).

Steps:

1. Created new database (beaker_test) and gave permissions to 'beaker'@'localhost'
2. Changed /etc/beaker/server.cfg to point to the newly created database.
3. Run beaker-init: beaker-init --user=admin --password=xxxx -e rjoost
4. Stop beakerd with: service beakerd stop
5. Run beakerd in foreground:
# /usr/bin/beakerd -f
2017-03-14 06:46:41,369 bkr.server.tools.beakerd DEBUG starting main recipes thread

No incomplete data migration messages have been observed.

Furthermore querying the database:

select * from data_migration;
+----+-----------------------------------+---------------------+
| id | name                              | finish_time         |
+----+-----------------------------------+---------------------+
|  1 | commands-for-recipe-installations | 2017-03-14 10:46:02 |
+----+-----------------------------------+---------------------+
1 row in set (0.00 sec)

Shows that the migration has a finish time.

Comment 4 Dan Callaghan 2017-03-30 03:23:01 UTC
Beaker 24.2 has been released.