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 gravity swapping #5455

Merged
merged 1 commit into from
Oct 22, 2023
Merged

Fix gravity swapping #5455

merged 1 commit into from
Oct 22, 2023

Conversation

DL6ER
Copy link
Member

@DL6ER DL6ER commented Oct 22, 2023

What does this implement/fix?

Swapping the databases must be the last step before the cleanup. Otherwise, FTL may be reloading from an only partially completed database causing spurious errors and/or warnings.

This fixes occasionally seen messages when pihole -g is run (either manually or automatically) such as

2023-10-22 03:12:08.093 [80311/T80329] INFO: Gravity database has been updated, reloading now
2023-10-22 03:12:08.096 [80311/T80329] ERR: gravityDB_count(SELECT value FROM info WHERE property = 'gravity_count';) - SQL error step no more rows available
2023-10-22 03:12:08.096 [80311/T80329] WARNING: Count of gravity domains not available. Please run pihole -g
2023-10-22 03:12:08.121 [80311/T80329] INFO: Compiled 0 allow and 4 deny regex for 20 clients in 24.0 msec

happening because the new database was already swapped into place before the corresponding numbers have been counted and written to the database.

Related issue or feature (if applicable): N/A

Pull request in docs with documentation (if applicable): N/A


By submitting this pull request, I confirm the following:

  1. I have read and understood the contributors guide, as well as this entire template. I understand which branch to base my commits and Pull Requests against.
  2. I have commented my proposed changes within the code.
  3. I am willing to help maintain this change if there are issues with it later.
  4. It is compatible with the EUPL 1.2 license
  5. I have squashed any insignificant commits. (git rebase)

Checklist:

  • The code change is tested and works locally.
  • I based my code and PRs against the repositories developmental branch.
  • I signed off all commits. Pi-hole enforces the DCO for all contributions
  • I signed all my commits. Pi-hole requires signatures to verify authorship
  • I have read the above and my PR is ready for review.

…rwise, FTL may be reloading from an only partially completed database causing spurious errors and/or warnings.

Signed-off-by: DL6ER <dl6er@dl6er.de>
@DL6ER DL6ER added Bug: fixed Contains a bug resolution Pi-hole v6.0 labels Oct 22, 2023
@DL6ER DL6ER requested a review from a team October 22, 2023 16:45
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pihole-up-destroy-correct-number-of-domains-on-adlist/65665/8

@DL6ER DL6ER merged commit 91c5967 into development-v6 Oct 22, 2023
14 checks passed
@DL6ER DL6ER deleted the fix/gravity_swaping branch October 22, 2023 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug: fixed Contains a bug resolution Pi-hole v6.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants