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

Fix IndexedDB xTruncate cache interaction #3

Closed
rhashimoto opened this issue May 2, 2021 · 0 comments
Closed

Fix IndexedDB xTruncate cache interaction #3

rhashimoto opened this issue May 2, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@rhashimoto
Copy link
Owner

The current implementation of xTruncate for IndexedDB pre-dates the addition of caching. In addition to updating the size in metadata, it deletes IndexedDB block objects past the EOF. If dirty blocks past EOF are in the cache, they will be written again on xSync.

The proper fix here is probably:

  • In xTruncate:
    • Update size in metadata (as before).
    • Remove blocks past EOF from the cache, not from IndexedDB.
  • In xSync:
    • After flushing the cache, delete IndexedDB block objects past EOF.
@rhashimoto rhashimoto added the bug Something isn't working label May 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant