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(gardener): avoid issues caused by stale databases #1516

Merged
merged 3 commits into from
Feb 14, 2024
Merged

Conversation

bassosimone
Copy link
Contributor

@bassosimone bassosimone commented Feb 14, 2024

We use a database to keep measurements results to allow to interrupt and resume the work, given that we have thousands or URLs to vet. However, after a week, the database is most likely stale, so let's just avoid trusting and start afresh in such a case. It's reasonable to assume that the database is stale after such an interval because the URL's status may have changed (e.g., some URLs could have stopped working).

Additionally, every time we run gardener sync we most likely have new URLs, so we need to do one of the following:

  1. merge new URLs into the database;

  2. just zap the database and start afresh.

Because doing 1. would be a bit time consuming, for now I am opting for doing 2. and we'll implement 1. if needed.

Closes ooni/probe#2684.

We use a database to keep measurements results to allow to interrupt
and resume the work, given that we have thousands or URLs to vet.

However, after a week, the database is most likely stale, so let's
just avoid trusting and start afresh in such a case.

It's reasonable to assume that the database is stale after such an
interval because the URL's status may have changed (e.g., some URLs
could have stopped working).

Additionally, every time we run `gardener sync` we most likely
have new URLs, so we need to do one of the following:

1. merge new URLs into the database;

2. just zap the database and start afresh.

Because doing 1. would be a bit time consuming, for now I am opting
for doing 2. and we'll implement 1. if we really need it.
@bassosimone bassosimone requested a review from hellais as a code owner February 14, 2024 10:46
If dnsreport.sqlite3 isn't regular, then there's something deeply
unexpected with the file system and we wouldn't want to zap something
that may be precious to the user.
@bassosimone bassosimone merged commit 813ba9e into master Feb 14, 2024
25 checks passed
@bassosimone bassosimone deleted the gardener branch February 14, 2024 17:35
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.

gardener: zap stale database
1 participant