Bug 4146

Summary: unbound-control set all EDNS queries as misses.
Product: unbound Reporter: Alex <alexandre.wicquart>
Component: serverAssignee: unbound team <unbound-team>
Status: RESOLVED FIXED    
Severity: normal CC: cathya, chantr4, wouter
Priority: P5    
Version: 1.7.3   
Hardware: x86_64   
OS: Linux   

Description Alex 2018-08-16 17:05:58 CEST
Hi,

unbound-control set cached EDNS queries as misses. 
Here is how to reproduce : 

unbound-edns ~ # systemctl restart unbound
unbound-edns ~ # unbound-control stats_noreset | egrep 'total.num.cachemiss|total.num.cachehits'
total.num.cachehits=0
total.num.cachemiss=0
unbound-edns ~ # time dig google.com +subnet=85.49.140.0/24 +short
172.217.17.14

real    0m0.594s
user    0m0.007s
sys     0m0.007s
unbound-edns ~ # unbound-control stats_noreset | egrep 'total.num.cachemiss|total.num.cachehits'
total.num.cachehits=0
total.num.cachemiss=1
unbound-edns ~ # time dig google.com +subnet=85.49.140.0/24 +short
172.217.17.14

real    0m0.017s
user    0m0.013s
sys     0m0.004s
unbound-edns ~ # unbound-control stats_noreset | egrep 'total.num.cachemiss|total.num.cachehits'
total.num.cachehits=0
total.num.cachemiss=2
unbound-edns ~ # 

Best Regards,
Alex.
Comment 1 Wouter Wijngaards 2018-08-21 16:33:14 CEST
Hi Alex,

Implemented two new counters for this, the num.query.subnet counter and the num.query.subnet_cache counter.  They count the number of responses to clients with edns subnet in there.  And the number that is answered from the EDNS subnet specific cache.  Those are still not counted in the total cache counter, because they are not from that cache, but they are separately kept track of.

Best regards, Wouter
Comment 2 Alex 2018-08-23 10:02:12 CEST
Hi Wouter,

Thanks for your patch. I have just made a try, and everything seems working. I see the new counters for subnet and increment is OK. 

Best Regards,
Alex
Comment 3 Manu Bretelle 2018-09-04 18:27:54 CEST
*** Bug 1302 has been marked as a duplicate of this bug. ***
Comment 4 Manu Bretelle 2018-09-04 18:29:58 CEST
Thanks Wouter!