Skip to content
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

IndexedDB VFS xClose doesn't flush the cache #10

Closed
rhashimoto opened this issue May 13, 2021 · 1 comment
Closed

IndexedDB VFS xClose doesn't flush the cache #10

rhashimoto opened this issue May 13, 2021 · 1 comment
Labels
bug

Comments

@rhashimoto
Copy link
Owner

@rhashimoto rhashimoto commented May 13, 2021

Right now the IndexedDB VFS cache only writes dirty blocks in xSync, not in xClose. xSync should always be called for database files, but I'm not certain whether that is true for journal files - I think it might depend on xDeviceCharacteristics flags (maybe SQLITE_IOCAP_SEQUENTIAL?).

@rhashimoto rhashimoto added the bug label May 13, 2021
@rhashimoto
Copy link
Owner Author

@rhashimoto rhashimoto commented May 13, 2021

xSync on journal files is indeed skipped when xDeviceCharacteristics returns SQLITE_IOCAP_SEQUENTIAL, e.g. here.

The current IndexedDB VFS does not set this flag so it should work correctly, but defensive programming would avoid injecting this bug in the future, e.g. by:

  • Adding a comment to xDeviceCharacteristics to warn about this, or
  • Checking the flag in xClose and syncing if present

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug
Projects
None yet
Development

No branches or pull requests

1 participant