-
Notifications
You must be signed in to change notification settings - Fork 472
fix(next storage): Force SQLite checkpoint on Pie and up #582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ab890e0
to
a53961f
Compare
krizzu
commented
Apr 9, 2021
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java
Show resolved
Hide resolved
tido64
reviewed
Apr 14, 2021
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java
Show resolved
Hide resolved
2e31f97
to
890799d
Compare
@tido64 thanks, ready for re-review 🙏 |
tido64
approved these changes
Apr 22, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncLocalStorageUtil.java
Outdated
Show resolved
Hide resolved
android/src/main/java/com/reactnativecommunity/asyncstorage/AsyncStoragePackage.java
Outdated
Show resolved
Hide resolved
🎉 This PR is included in version 1.15.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
From Pie and up, Android started to use Write-ahead logging (WAL) by default, instead of journal rollback. WAL does not write directly to the database file, rather to the supporting WAL file. The content of WAL file is "flushed" to original DB file (this action is called a checkpoint), when page size threshold is reached (default is 1000).
Because of that, migration to Next storage might not be successful, because RKStorage database content might still be in WAL file (and Next AsyncStorage uses RKStorage file to rehydrate itself). This PR introduces a helper that will make sure we force checkpoint, to always have the latest content on db file, before migrating.
@EvanBacon I suspect we'd want the same thing happen for Expo migration as well?