Problem when using Migration Managers and journal_mode WAL #490

Closed
pbendersky opened this Issue May 24, 2013 · 8 comments

Projects

None yet

5 participants

@pbendersky

Hi guys,
I recently discovered a bug when using a Migration Manager to make advanced migrations in Core Data (I migrated a many-to-many to an entity, that's why I needed it) and journal_mode = WAL (the default for MR).

It seems as if Core Data keeps the old -wal file after performing the migration, ending up with an inconsistent database. You can see more details (and a workaround) here: http://pablin.org/2013/05/24/problems-with-core-data-migration-manager-and-journal-mode-wal/

I also submitted a Radar to Apple over this issue: http://openradar.appspot.com/radar?id=3031401

Do you think MagicalRecord should implement a workaround like the one I described?

@blackgold9
Member

I think you're exactly right. I'm in the WWDC lab right now and I'm about to ask about it.

@jogu
jogu commented Jul 5, 2013

@blackgold9 Did you find out anything further in the lab?

@blackgold9
Member

I did. He was pretty sure there's a bug in pre 7 that didn't clean out the
sidecar files on migrations. The trick another contributor added for auto
migrations was, when detecting a migration was necessary, opening it in the
normal journaling mode (DELETE i believe), which wipes out the sidecar
files, doing the migration, then re-opening the PSC with WAL again. I think
we can do something similar for manual migrations.

On Fri, Jul 5, 2013 at 4:01 AM, Joseph Heenan notifications@github.comwrote:

@blackgold9 https://github.com/blackgold9 Did you find out anything
further in the lab?


Reply to this email directly or view it on GitHubhttps://github.com/magicalpanda/MagicalRecord/issues/490#issuecomment-20513503
.

@pbendersky

Yes, that's the workaround I posted in Radar and what I'm using in my app. It works, although I wonder how safe it is for a larger DB.

@ziel
ziel commented Aug 19, 2013

In case it's useful... I just ran into something similar. I'm using the concept from pbendersky's workaround which seems to make things ok. So err... +1 or something.

@pbendersky

Can you duplicate the bug report in Radar? http://openradar.appspot.com/radar?id=3031401 Maybe it will gather more attention for the next release.

@ziel
ziel commented Aug 23, 2013

Submitted a report at https://bugreport.apple.com/. I modified your description slightly to reflect what I saw -- which is an empty store... but referenced your report in Radar.

@tonyarnold
Contributor

Given the age of this issue, and the volume of issues we have to work through, I've decided to close this alongside a number of other older issues.

If you can still replicate the issue under the latest in-development version of MagicalRecord (3.0 at the time of writing), please feel free to re-open and one of @magicalpanda/team-magicalrecord will take another look. Thanks!

@tonyarnold tonyarnold closed this Apr 8, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment