Implement minheap based freshness waiter
The Issue & Context
Before this PR, goroutines waiting for resource version (RV) updates were all woken up on every RV update, causing excessive wakeups and high CPU overhead under dense update workloads, notably degrading ConsistentGetFromCache performance.
Root Cause Analysis
The freshness waiter used a broadcast-style wakeup mechanism that signaled all waiting goroutines on any RV update, leading to O(n*m) wakeup complexity where n is waiters and m is updates, because there was no prioritization or selective wakeup based on the RVs each goroutine waited for.
Solution Strategy & Architectural Pattern
This PR replaces the broadcast wakeup with a min-heap data structure tracking the RVs each goroutine waits for, enabling a dedicated background goroutine to wake up only those waiters whose RVs are reached, reducing complexity to amortized O(log n) for registering/unregistering waiters and avoiding unnecessary wakeups. Changes were made primarily in watch_cache_freshness.go to implement this min-heap based freshness waiter.
Key Takeaway for Contributors
When multiple concurrent waiters depend on ordered events (like RVs), using a priority queue or min-heap to track the earliest needed event enables selective wakeups and significantly reduces contention and CPU overhead compared to naive broadcast signaling.