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

Remove conservative deletes on restarts #63

Merged
merged 3 commits into from
Oct 4, 2024

Conversation

harisang
Copy link
Contributor

@harisang harisang commented Oct 4, 2024

When the daemon restarts, it acts conservatively and deletes the latest entry found in the db, in order to recheck that block. This aims to catch cases where the daemon crashed in the middle of writing in the db. Given that current error handling is not great, this has resulted in cases where the daemon starts crashes and actually starts deleting entries, one by one, ending up in deleting days of data.

This PR proposes to remove this deletion step until we make the daemon very robust, and until we are convinced it is needed. Moreover, it forces the daemon to not look too far back in the past (at most 1 day), and if latest data is older than 1 day, then it ignores the gaps and continues from latest block. In practice, we should not expect downtimes of more than 1 day, so this should be fine in most cases.

Copy link
Contributor

@fhenneke fhenneke left a comment

Choose a reason for hiding this comment

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

Just rubber stamping and merging this.

I do not know how to test this change. I also do not think the change to allow for gaps in data should be in this code base unless there is other scripts which can fill gaps. I added TODOs to the code and will create an issue.

@fhenneke fhenneke merged commit a8814b2 into main Oct 4, 2024
3 checks passed
@fhenneke fhenneke deleted the remove_deleting_on_restarts branch October 4, 2024 09:18
@fhenneke fhenneke mentioned this pull request Oct 4, 2024
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