Skip to content

dnsdist: add bloom filter accessible from Lua - #17890

Draft
esensar wants to merge 7 commits into
PowerDNS:masterfrom
esensar:feature/lua-bloom-filter
Draft

dnsdist: add bloom filter accessible from Lua #17890
esensar wants to merge 7 commits into
PowerDNS:masterfrom
esensar:feature/lua-bloom-filter

Conversation

@esensar

@esensar esensar commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Short description

Further extends #17561 with a bloom filter instead of a cache, allowing presence checks with a lower memory usage.

Checklist

I have:

  • read the CONTRIBUTING.md document
  • read and accepted the Developer Certificate of Origin document, including the AI Policy, and added a "Signed-off-by" to my commits
  • compiled this code
  • tested this code
  • included documentation (including possible behaviour changes)
  • documented the code
  • added or modified regression test(s)
  • added or modified unit test(s)

Sponsored by Quad9

esensar added 7 commits August 7, 2026 19:37
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
Signed-off-by: Ensar Sarajčić <dev@ensarsarajcic.com>
@esensar

esensar commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

This depends on #17561 - if and once that gets merged, I will rebase this.

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 31519278567

Coverage increased (+1.4%) to 68.452%

Details

  • Coverage increased (+1.4%) from the base build.
  • Patch coverage: 28 uncovered changes across 1 file (104 of 132 lines covered, 78.79%).
  • 3587 coverage regressions across 68 files.

Uncovered Changes

File Changed Covered %
pdns/stable-bloom.hh 132 104 78.79%

Coverage Regressions

3587 previously-covered lines in 68 files lost coverage.

Top 10 Files by Coverage Loss Lines Losing Coverage Coverage
pdns/tcpiohandler.cc 521 27.26%
pdns/libssl.cc 500 6.54%
pdns/pkcs11signers.cc 484 0.42%
modules/bindbackend/bindbackend2.cc 286 35.96%
modules/lmdbbackend/lmdbbackend.cc 191 65.64%
pdns/misc.cc 180 50.25%
pdns/tcpiohandler.hh 179 30.41%
pdns/dnsparser.cc 135 72.87%
pdns/iputils.hh 115 68.44%
pdns/ws-auth.cc 113 76.7%

Coverage Stats

Coverage Status
Relevant Lines: 114392
Covered Lines: 85014
Line Coverage: 74.32%
Relevant Branches: 57406
Covered Branches: 32586
Branch Coverage: 56.76%
Branches in Coverage %: Yes
Coverage Strength: 8935629.52 hits per line

💛 - Coveralls

@edmonds

edmonds commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

It looks like there is a custom Bloom filter implementation in here. I would instead recommend the (heavily optimized and reviewed) Bloom filter that was added to Boost recently (https://www.boost.org/doc/libs/latest/libs/bloom/doc/html/bloom.html) even though it requires a more up-to-date Boost than is typically available in the stable distros.

@esensar

esensar commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

It looks like there is a custom Bloom filter implementation in here. I would instead recommend the (heavily optimized and reviewed) Bloom filter that was added to Boost recently (https://www.boost.org/doc/libs/latest/libs/bloom/doc/html/bloom.html) even though it requires a more up-to-date Boost than is typically available in the stable distros.

Thanks for the suggestion. I just used the implementation that was already present and used in the project - seemed like the safest option.

@rgacogne

Copy link
Copy Markdown
Member

I like the idea, and I agree using the existing implementation is the right thing to do (whether we might want to switch to the Boost one when available is a different discussion). Let's get #17561 merged first (I have been lagging behind, sorry about that).

@esensar

esensar commented Aug 18, 2026

Copy link
Copy Markdown
Contributor Author

Understood - sorry about all of these drafts, I wanted to get them in a reviewable state, because I have been dragging it around in WIP branches for some time.

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.

4 participants