sled
sled copied to clipboard
Autoflushing not working on Android
- expected result Inserting a value into the db should persist to disk
- actual result Value is not persisted and does not show up in queries on restarting process
- sled version 0.34.6
- rustc version rustc 1.51.0 (2fd73fabe 2021-03-23)
- operating system Android (built on Windows)
- minimal code sample that helps to reproduce the issue https://github.com/allforabit/SledIssue
I've created a repo that should reproduces the issue. I've only started rust so the code is not the best! It's best to use android studio to run it so I hope this doesn't cause too much inconvenience.
Thanks!
On android there is dynamic fsync
which prevents immediate flush.
There are two options either to wait or to use sync
call which forces it to be performed regardless of Android desires.
Note that it is only the case when there is active application (i.e. screen is not locked), as soon as phone goes into sleep mode or is locked it should perform fsync