-
Notifications
You must be signed in to change notification settings - Fork 925
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
lmdb-safe: add prefix() cursor; use it in list/lookup/get #15176
Conversation
Pull Request Test Coverage Report for Build 13587579875Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic of the for
loop in LMDBBackend::updateDNSSECOrderNameAndAuth
might also be able to benefit from this, the for
condition being now implied by the fact we didn't break
out of it.
Indeed! Unrelated thought: perhaps other cursor initializers should reset (empty) |
@@ -1534,7 +1534,7 @@ void LMDBBackend::lookup(const QType& type, const DNSName& qdomain, int zoneId, | |||
d_matchkey = co(zoneId, relqname, type.getCode()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this case (including type) does not even need to be a prefix query - a simple get
by this key would yield the same result. But, after this PR, I'm not sure it matters much.
Resetting |
Because I'm curious I'm going to assert emptiness first, see what dies :) |
nothing died, but it made me realise that |
33f55e5
to
45c1bc4
Compare
done |
ready for another review round (I'll squash later) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good.
a95908c
to
bdf6ccd
Compare
squashed, plus two new commits. Waiting for green :) |
Good catch with the 3rd commit. |
I was renaming the short vars because clang-tidy complained and then it hit me. I'm sure the bruises won't stick around for too long. |
Ah, yes, good old "commit by serendipity" technique. |
bdf6ccd
to
e8c23ea
Compare
Short description
Posted for first review. Bit draft still.
After updating
lookup()
andget()
for the prefix method, I also had to updatelist()
(as that also just prepares us forget()
).I don't think any other functions in lmdbbackend.cc need updating to work correctly; I do think a few more could benefit.
I copied the StringView define from lmdbbackend.cc but I'm not sure it's doing the right thing (in either place perhaps). It's also possible that we can fully rely on having the right Boost version these days.
Checklist
I have: