-
-
Notifications
You must be signed in to change notification settings - Fork 342
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
Redis TTL #206
Redis TTL #206
Conversation
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.
Nice work! Although I have left some remarks that need to be addressed in the code before merging.
Some features that I would also like to see with this PR (ordered by difficulty/amount of work):
- Use of
SETEX
instead ofSET .. EX ..
. From the documentation SETEX is not deprecated and supported in earlier versions than SET EX. - Configuration option for redis to explicitly allow this behavior or not. (Default would be no, in order to maintain backwards compatibility)
- Detect SETEX redis support when cachedb initiates and error out if not.
If you want to tackle them as well feel free! Otherwise let me know and I will add them with this PR.
HI @gthess , thanks for the review, I will tackle the requested changes on my end to get some experience with changing unbound code. Bye |
Hi @gthess , I have now added the changes. Creating a new option is quite a complex task... ;) Now my git shows me the following files as changed:
some of them are auto generated so the question is, if I should include all of them in my commit? |
… redis records added check for redis command 'setex' when initializing redis connection updated documentation minor improvements to previous changes
I committed all changed files, please merge only the ones you think are necessary. Thanks! |
Thanks, from a first look everything seems good and in place! |
Great! Thanks! |
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.
Nice almost done!
Apart from the remarks one editorial nit: I would use redis-expire-records instead of redis-set-ttl to avoid any confusion with the actual DNS TTL.
renamed option from 'redis-set-ttl' to 'redis-expire-records'
Thanks for sticking with this! |
Thanks for your help and guidance! |
* nlnet/master: (30 commits) - Merge PR NLnetLabs#214 from gearnode: unbound-control-setup recreate certificates. With the -r option the certificates are created again, without it, only the files that do not exist are created. fix unbound-control-setup is not idempotent - Keep track of number of timeouts. Use this counter to determine if capsforid fallback should be started. - More documentation for redis-expire-records option. - Changes for PR NLnetLabs#206 (formatting and remade lex and yacc output). changed init logic of redis backend as per review request implemented review feedback renamed option from 'redis-set-ttl' to 'redis-expire-records' added option 'redis-set-ttl' to define whether ttl should be added to redis records added check for redis command 'setex' when initializing redis connection updated documentation minor improvements to previous changes - Merge PR NLnetLabs#208: Fix uncached CLIENT_RESPONSE'es on stateful transports. Send tcp_req_info->spool_buffer as dnstap CLIENT_RESPONSE Fix uncached CLIENT_RESPONSE'es on stateful transports nroff fix for dash. - Merge PR NLnetLabs#207: Clarify if-automatic listens on 0.0.0.0 and :: Clarify if-automatic listens on 0.0.0.0 and :: honor 'server_expired_ttl' in redis added logic for redis to honor ttl when serve_expired is not enabled Changelog note for PR NLnetLabs#203. - Merge PR NLnetLabs#203 from noloader: Update README-Travis.md with current procedures. Make unbound-control error returned on missing domain name more user friendly. Update README-Travis.md with current procedures - Fix RPZ concurrency issue when using auth_zone_reload. ...
This is my first time changing unbound code so sorry for any "obvious" errors :)
Currently unbound does not provide any TTL information to Redis when storing values. This makes setups quite complex as every single redis instance needs to take care of eviction policies, which might not always be trivial to define. The code does 4 things:
I am running the code for a few days now and there are no issues so far. Which, of course, does not mean there there aren't any :)
some things to discuss:
Thanks!