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

Save block count in the DB when calculated in Cache module #7062

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

vbaranov
Copy link
Member

@vbaranov vbaranov commented Mar 10, 2023

Resolves #7032

Motivation

On application restart ETS cache is empty and blocks indexed ratio is based on estimated count from reltuples from pg_class query. Thus indexing banner may appear on every restart. We need to keep status of indexing in the DB as well.

Changelog

On every calculated from DB count of blocks from Explorer.Chain.Cache.Block module, save the counter value in last_fetched_counters table and use it, if ETS cache is empty.

Checklist for your Pull Request (PR)

@vbaranov vbaranov force-pushed the vb-save-block-count-in-db branch 5 times, most recently from 22fb292 to af69254 Compare March 13, 2023 09:38
@vbaranov vbaranov requested review from nikitosing and sl1depengwyn and removed request for nikitosing March 13, 2023 10:17
@vbaranov vbaranov merged commit 8200dfa into master Mar 13, 2023
@vbaranov vbaranov deleted the vb-save-block-count-in-db branch May 9, 2023 14:22
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.

Stuck Blocks-Indexed
2 participants