Switch sqlite temp storage to disk; fix failures in V16#11600
Conversation
| fun getInstance(): DroidBackend { | ||
| // Prevent sqlite throwing error 6410 due to the lack of /tmp | ||
| val dir = AnkiDroidApp.getInstance().applicationContext.cacheDir | ||
| Os.setenv("TMPDIR", dir.path, false) |
There was a problem hiding this comment.
Discussion began here: ankitects/anki@f15e294#r75810592
I'm +1 on this change I think it is the only way to be sure we won't overflow JVM heap on android
Original fix attempt and discussion at ankidroid/Anki-Android-Backend#193
|
I've updated this so it will apply cleanly without the Java backend change. |
mikehardy
left a comment
There was a problem hiding this comment.
Nice, this looks good to go all by itself and having read related issues I think it's a necessary change for reliability
|
Pulled locally:
mike@bistromath:~/work/AnkiDroid/Anki-Android-Upstream (tmp-fix *) % git stash show -p
diff --git a/AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java b/AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java
index fcb25ce71..aff48859f 100644
--- a/AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java
+++ b/AnkiDroid/src/main/java/com/ichi2/anki/AnkiDroidApp.java
@@ -87,7 +87,7 @@ public class AnkiDroidApp extends Application {
*
* Set this and {@link com.ichi2.libanki.Consts#SCHEMA_VERSION} to 16.
*/
- public static boolean TESTING_USE_V16_BACKEND = false;
+ public static boolean TESTING_USE_V16_BACKEND = true;
public static final String XML_CUSTOM_NAMESPACE = "http://arbitrary.app.namespace/com.ichi2.anki";
diff --git a/AnkiDroid/src/main/java/com/ichi2/libanki/Consts.kt b/AnkiDroid/src/main/java/com/ichi2/libanki/Consts.kt
index 495b5ec00..b79144952 100644
--- a/AnkiDroid/src/main/java/com/ichi2/libanki/Consts.kt
+++ b/AnkiDroid/src/main/java/com/ichi2/libanki/Consts.kt
@@ -106,7 +106,7 @@ object Consts {
// deck schema & syncing vars
@JvmField
- var SCHEMA_VERSION = 11
+ var SCHEMA_VERSION = 16
/** The database schema version that we can downgrade from */
const val SCHEMA_DOWNGRADE_SUPPORTED_VERSION = 16...and that fails That's not a regression, it is what I see on main (running V16 test on existing V11 collection not working for me) so this seems good Definitely not a regression for V11 folks not doing V16-experimental stuff on main |
Original fix attempt and discussion at ankidroid/Anki-Android-Backend#193
Depends on #11581