realm / realm-java

Realm is a mobile database: a replacement for SQLite & ORMs
http://realm.io
Apache License 2.0
11.45k stars 1.75k forks source link

Upgrade file format to v23 #7779

Closed sipersso closed 1 year ago

sipersso commented 1 year ago

Problem

I am using local realms on both iOS and Android and share realm files between platforms. The iOS SDK and the Kotlin SDK supports realm file version 23, but this is not possible to open with the java SDK that is still on version 22. The Kotlin SDK was upgraded on 2023-01-25, but the Java SDK is still a version behind. Is this upgrade for the Java SDK in the works?

I am using local databases on both iOS and Android (even though I want to get on Atlas eventually), and without this bump I am not able to upgrade the iOS SDK. This is essential to me as the current version I am on has problems with corruptions/dirty sync pages, which was fixed a couple of months ago. Unfortunately that version caused crashes at startup for the iOS app due to another change introduced, which has finally been fixed, but then bumped the file format version making it incompatible with realm Java :/

When will Realm Java get a bump to v 23?

Solution

Upgrade the file format version of Realm Java to v 23

Alternatives

Migrating to the Kotlin SDK, but this would potentially be a big piece of work that will probably take me very long to implement.

How important is this improvement for you?

Dealbreaker

Feature would mainly be used with

Local Database only

BlueCobold commented 1 year ago

Same issue here. PR is open for a while now... https://github.com/realm/realm-java/pull/7746

cmelchior commented 1 year ago

Sorry for the delay, we had a few bumps along the way. But we are actively working on getting Core 13 support done. It also depends on: https://github.com/realm/realm-java/pull/7760

tuandinh0801 commented 1 year ago

Hi @cmelchior, any updates on this? I tried v10.13.1 but seems like still using realm core v12.6.0

BlueCobold commented 1 year ago

@tuandinh0801 Because it does. The changelog is incorrect (it says 10.13.1 is using file format 23, but it's not). I already complained about it, but it was only partly corrected.

clementetb commented 1 year ago

@tuandinh0801 we will get the core 13 update in the 10.14.0 release.

BlueCobold commented 1 year ago

@clementetb Can you then please fix the Changelog? It still says it uses v23. The incorrect core-update-notice was removed, but the incorrect file-version was left in.

BlueCobold commented 1 year ago

This is still open and very urgent. Is there any ETA for release 10.14.x?

rorbech commented 1 year ago

I am working on it and it should land later today or tomorrow. If it is really urgent you can use the 10.14.0-SNAPSHOT in the meantime.

sipersso commented 1 year ago

What core version will it have @rorbech? In the latest version there is a huge issue with compaction, causing crashes and corrupted data files. It could be traced back to core. Just want to know if I can safely upgrade or not when this is released.

rorbech commented 1 year ago

@sipersso 10.14.0 will be targeting Realm Core 13.9.0 as of commit 063927de66f79a0afffbbe36c0bb14d27deba8f2. Can you elaborate on what latest version you refer to and your observations?

sipersso commented 1 year ago

When upgrading from Realm 10.12.0 to 10.13.0 I got a bunch of users complaining about corrupted files. Reverting to the old version fixed the issue. If I upgrade to 10.14.0 there it won't be possible to revert since the file format has changed, so I need to be sure that the new version won't cause corruptions like the 10.13.0 version did. See more here: https://github.com/realm/realm-java/issues/7775

rorbech commented 1 year ago

There has been fixes around compaction issues in Core 13.1.0 (https://github.com/realm/realm-core/pull/6054) but since we have not been able to provoke your specific observations from #7775 we cannot guarantee that it adresses your specific issue.

BlueCobold commented 1 year ago

@sipersso Did you also try 10.13.1? All my app users (over 8000) use 10.13.0 without any corrupted file issues - I should note though, that I have a strict queued single-thread-access to my realms (which I added because parallel access did corrupt my files in the past).

sipersso commented 1 year ago

@BlueCobold I haven't tried 10.13.1 since the https://github.com/realm/realm-java/issues/7775 issue has not been closed yet. I don't want to risk my users getting corrupted files.

BlueCobold commented 1 year ago

@sipersso Then maybe that specific bug should be discussed in that ticket instead. My problem is not having issues with 10.13.0, but having a problem with sticking to v22 while the other platforms have moved to 23 months ago (as what this ticket is about).

rorbech commented 1 year ago

10.14.0 that uses file format v23 has been released.