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

pogreb: non-blocking recovery #486

Merged
merged 1 commit into from
Aug 3, 2023
Merged

Conversation

ptrus
Copy link
Member

@ptrus ptrus commented Jul 13, 2023

pogreb , the backing KV store for the cache, blocks the entire indexer for potentially multiple hours if it needs to reindex the cache (which happens whenever the database is not closed cleanly).

This PR updates the KVStore to open the backing DB in the background. The OpenKVStore will block for a maximum of 30 seconds. If the database is not opened within that period, it is likely doing the reindexing, and it will continue to do so in the background. Meanwhile, the store will work and behave as if it had an empty backing DB.

Testing:

Artificially added timeouts to the pogreb initialization and tested on a local instance. It works as expected, the indexer starts while the pogreb is initializing in the background. And after the db is initialized, the cache is used.

@ptrus ptrus force-pushed the ptrus/feature/pogreb-reindex-background branch 4 times, most recently from b86efa1 to 7ccb33e Compare July 15, 2023 11:37
Copy link
Contributor

@mitjat mitjat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

storage/oasis/nodeapi/file/kvstore.go Show resolved Hide resolved
@ptrus ptrus force-pushed the ptrus/feature/pogreb-reindex-background branch from 7ccb33e to 27bed91 Compare August 3, 2023 12:48
@ptrus ptrus enabled auto-merge August 3, 2023 12:48
@ptrus ptrus merged commit 803ca11 into main Aug 3, 2023
@ptrus ptrus deleted the ptrus/feature/pogreb-reindex-background branch August 3, 2023 12:53
@ptrus ptrus restored the ptrus/feature/pogreb-reindex-background branch August 3, 2023 13:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants