Skip to content

Fix spilled queries in database#1960

Merged
DL6ER merged 2 commits into
development-v6from
fix/database_queries
May 15, 2024
Merged

Fix spilled queries in database#1960
DL6ER merged 2 commits into
development-v6from
fix/database_queries

Conversation

@DL6ER

@DL6ER DL6ER commented May 14, 2024

Copy link
Copy Markdown
Member

What does this implement/fix?

Improve query storing algorithm to better cope with bursts of queries of arbitrary size and frequency. See related Discourse bug chasing for further details.

This is overall an improvement as the new strategy guarantees that no queries can be lost on one hand and drastically reduces the workload on the other hand by using persistent prepared statements instead of compiling them once per second.


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.

DL6ER added 2 commits May 14, 2024 20:17
… of arbitrary size and frequency

Signed-off-by: DL6ER <dl6er@dl6er.de>
@pralor-bot

Copy link
Copy Markdown

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

https://discourse.pi-hole.net/t/discrepancy-between-pi-hole-api-client-query-count-and-logs/70065/17

@DL6ER DL6ER marked this pull request as ready for review May 15, 2024 16:26
@DL6ER DL6ER requested a review from a team May 15, 2024 16:27
@DL6ER

DL6ER commented May 15, 2024

Copy link
Copy Markdown
Member Author

Confirmed working by letting this run locally for 2 days by now and independent confirmation by OP on Discourse:

https://discourse.pi-hole.net/t/discrepancy-between-pi-hole-api-client-query-count-and-logs/70065/19

@DL6ER DL6ER merged commit 3d4cc1b into development-v6 May 15, 2024
@DL6ER DL6ER deleted the fix/database_queries branch May 15, 2024 18:42
@PromoFaux PromoFaux mentioned this pull request Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants