TODO 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Long term:
  2. * Make a mechanism the cache (which does not exist at the time of writing this
  3. note) will be able to notify the NSAS that something has changed (address,
  4. new nameserver, etc). Because the cache will have access to the data and
  5. knows when it changes (it updates its structures), it is the best place. It
  6. will be caching even data like authority and additional sections. It will
  7. notify us somehow (we will need to tell it when).
  8. The changes we need to know about is when set of nameservers or set of
  9. addresses for a nameserver change and when a NS record or nameserver's A or
  10. AAAA record is explicitly removed from the cache.
  11. * Optimisation to pass max two outstanding queries on the network (but fetch
  12. everything from cache right away). The first can be done by having number of
  13. packets on the network, with max of 4 (each query are 2 of them, A and AAAA),
  14. if it drops to 2, another one can be send.
  15. * Add the cache cookies/contexts.
  16. * Logging.
  17. * Remove LRU from the nameserver entries, drop them when they are not
  18. referenced by any zone entry. This will remove duplicates, keep the RTTs
  19. longer and will provide access to everything that exists. This is
  20. tricky, though, because we need to be thread safe. There seems to be
  21. solution to use weak_ptr inside the hash_table instead of shared_ptr and
  22. catch the exception inside get() (and getOrAdd) and delete the dead pointer.
  23. * Better way to dispatch all calbacks in a list is needed. We take them out of
  24. the list and dispatch them one by one. This is wrong because when an
  25. exception happens inside the callback, we lose the ones not dispatched yet.
  26. What should be done in this situation anyway? Putting them back? Will anybody
  27. still call them? Taking them one by one?
  28. Or recommend that if the result is really needed, that destruction of it
  29. should be considered failure if it wasn't called yet? Make it the default
  30. (eg. signal failure by destruction or call that function from destructor)?
  31. * Make a zone entry hash table have multiple LRU lists, each one for part of the
  32. slots. This will prevent locking contention while still keeping close to
  33. the theoretical LRU behaviour (statistically, accesses to each of the part
  34. should be as common as to others).
  35. It might be a good idea to encapsulate the LRUs into the hash table directly
  36. (or create a class holding both the hash table and the LRU lists).