← Back to team overview

brewtarget-devs team mailing list archive

Re: New migration code

 

Nah, you were exactly right. I didn't properly handle errors inside the
migration transaction. I just put up a fix for this [MR #91](
https://gitorious.org/brewtarget/brewtarget/merge_requests/91). This ensure
that a migration will never put the database in a bad half-migrated state,
but instead will warn you and refuse to start.


On Sat, Aug 9, 2014 at 9:35 AM, Philip Lee <rocketman768@xxxxxxxxx> wrote:

> Nah, you were exactly right. I didn't properly handle errors inside the
> migration transaction. I just put up a fix for this [MR #91](
> https://gitorious.org/brewtarget/brewtarget/merge_requests/91). This
> ensure that a migration will never put the database in a bad half-migrated
> state, but instead will warn you and refuse to start.
>
>
> On Fri, Aug 8, 2014 at 8:38 AM, mik firestone <mikfire@xxxxxxxxx> wrote:
>
>> Heh. I've got backups. I will move this over to one of my vms and start
>> beating on it. I am also not 100% my analysis was correct; it was late and
>> I am deep into the Unit systems. So this was an unexpected speed bump and I
>> was more concerned with getting it working than diagnosing the issue.
>>
>> Mik
>>
>>
>> On Fri, Aug 8, 2014 at 9:15 AM, Philip Lee <rocketman768@xxxxxxxxx>
>> wrote:
>>
>>> This makes me worry. All the migrations are done in a transaction. If
>>> any statement fails, my understanding is that the migration simply won't
>>> occur at all and should leave you with the database you had.
>>>
>>> --
>>> Philip G. Lee
>>> www.linkedin.com/in/philipgreggorylee
>>> On Aug 8, 2014 7:47 AM, "mik firestone" <mikfire@xxxxxxxxx> wrote:
>>>
>>>> No, it got sideways. As near as I can figure, I already had the folders
>>>> defined. This threw the entire process for a loop, and somehow the settings
>>>> table got dropped and/or reset. Once that table is gone, the code assumes
>>>> it is a v2.0.0 database. Nothing good was going to happen after that.
>>>>
>>>> I restored from the attached tarball, modified the database schema code
>>>> to mostly skip all of the folder stuff and then pick up from there. It
>>>> seems to work fine now.
>>>>
>>>> I still vote we make at least version n-1 backups. We have the
>>>> installer code almost already done. Just need to build a string like
>>>> "database-[version]-backup.sqlite" and do the copy.
>>>>
>>>> Mik
>>>>
>>>>
>>>> On Fri, Aug 8, 2014 at 8:20 AM, Philip Lee <rocketman768@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Send me db. I bet your settings table does not have
>>>>> repopulateChildren...
>>>>>
>>>>> --
>>>>> Philip G. Lee
>>>>> www.linkedin.com/in/philipgreggorylee
>>>>> On Aug 7, 2014 10:32 PM, "mik firestone" <mikfire@xxxxxxxxx> wrote:
>>>>>
>>>>>>  If I build against HEAD with my host machine and then run
>>>>>> brewtarget, I get a "ERROR: Database migration 3->4 failed". Every time I
>>>>>> start brewtarget after that, I get a "ERROR: Database migration 1->4
>>>>>> failed".
>>>>>>
>>>>>> I am elbow deep in chasing down another problem, so I don't have a
>>>>>> lot of spare cycles to attack this one. Can somebody tell me what the
>>>>>> malfunction is, why I'm getting it, what I can do about it and do we expect
>>>>>> this to happen to normal people or am I just kind of boned because I'm a
>>>>>> dev?
>>>>>>
>>>>>> Thanks,
>>>>>> Mik
>>>>>>
>>>>>> --
>>>>>> In a world of ninja v. pirate, I pilot a Gundam
>>>>>>
>>>>>> --
>>>>>> Mailing list: https://launchpad.net/~brewtarget-devs
>>>>>> Post to     : brewtarget-devs@xxxxxxxxxxxxxxxxxxx
>>>>>> Unsubscribe : https://launchpad.net/~brewtarget-devs
>>>>>> More help   : https://help.launchpad.net/ListHelp
>>>>>>
>>>>>>
>>>>
>>>>
>>>> --
>>>> In a world of ninja v. pirate, I pilot a Gundam
>>>>
>>>
>>
>>
>> --
>> In a world of ninja v. pirate, I pilot a Gundam
>>
>
>
>
> --
> Philip G. Lee
> www.linkedin.com/in/philipgreggorylee
>



-- 
Philip G. Lee
www.linkedin.com/in/philipgreggorylee

References