chore(spanner): implement cache updater for location-aware routing - #6271
chore(spanner): implement cache updater for location-aware routing#6271olavloite wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces the CacheUpdater module to handle location-aware routing cache updates by applying CacheUpdate payloads to the KeyRangeCache and pre-warming server connections in the ConnectionCache. The review feedback recommends using a safer, error-returning method like try_get instead of get to avoid potential panics when pre-warming connections, as well as logging errors instead of swallowing them. Additionally, it suggests replacing flaky tokio::task::yield_now() calls in unit tests with a robust polling mechanism with a timeout.
Implement `CacheUpdater` to coordinate between Spanner `CacheUpdate` wire messages and the client's in-memory routing table (`KeyRangeCache`) and connection pool (`ConnectionCache`).
577889d to
3a3013d
Compare
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces the CacheUpdater module to the Spanner location-aware routing implementation. CacheUpdater coordinates the ingestion of CacheUpdate payloads, applying updates to the in-memory KeyRangeCache and asynchronously pre-warming server connections in the ConnectionCache using the Tokio runtime. A comprehensive suite of unit tests has been added to verify its behavior, including deduplication and generation updates. There are no review comments to address, and the implementation aligns with the repository's style guidelines.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6271 +/- ##
==========================================
+ Coverage 96.24% 96.26% +0.01%
==========================================
Files 280 281 +1
Lines 72146 72499 +353
==========================================
+ Hits 69440 69790 +350
- Misses 2706 2709 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Implement
CacheUpdaterto coordinate between SpannerCacheUpdatewire messages and the client's in-memory routing table (KeyRangeCache) and connection pool (ConnectionCache).