Redesign the HS client descriptor cache
We merged a patch here, but see arma's comment below.
Bug legacy/trac#16381 (moved) vs legacy/trac#14219 (moved) demonstarted an important issue with the current design of the HS client descriptor cache.
In a nutshell, we can't rely on the timestamp to order descriptors because the timestamp is rounded down to the nearest hour thus any change in that time period will never be seen by the client (legacy/trac#16381 (moved)). Furthermore, we can't rely on comparing the descriptor content because we have two replicas with the same content but have different descriptor ID (legacy/trac#14219 (moved)).
One solution proposed by arma (and +1 by special) is to redesign the logic to be cleaner, and keep an intro point failure cache. It seems like every time we encounter this "we keep state about the previous hs desc by keeping a copy of it, and then seeing if the new one is different, get it?" logic, somebody finds it confusing. Maybe now is a good time for it to die? :)