sled icon indicating copy to clipboard operation
sled copied to clipboard

Autoflushing not working on Android

Open allforabit opened this issue 3 years ago • 1 comments

  1. expected result Inserting a value into the db should persist to disk
  2. actual result Value is not persisted and does not show up in queries on restarting process
  3. sled version 0.34.6
  4. rustc version rustc 1.51.0 (2fd73fabe 2021-03-23)
  5. operating system Android (built on Windows)
  6. 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!

allforabit avatar Apr 28 '21 14:04 allforabit

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

DoumanAsh avatar Jun 15 '21 01:06 DoumanAsh