fix(storage): remove duplicate Query calls from AsyncWriterConnectionBuffered and AsyncWriterConnectionResumed - #16315
Conversation
…Buffered and AsyncWriterConnectionResumed
There was a problem hiding this comment.
Code Review
This pull request refactors both the buffered and resumed async writer connections to retrieve the persisted size directly from the connection's persisted state instead of making an asynchronous query call, and updates the corresponding tests. The review feedback identifies three opportunities to avoid unnecessary copies of non-fundamental types, specifically recommending the use of const references for the persisted state and moving the status result when setting the flushed state.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16315 +/- ##
==========================================
- Coverage 92.24% 92.23% -0.01%
==========================================
Files 2227 2227
Lines 209234 209169 -65
==========================================
- Hits 193008 192934 -74
- Misses 16226 16235 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Following the merge of PR #16307,
Flush()now guarantees that server state (persisted_size) is fully updated before satisfying its future. SinceFlush()handles network synchronization natively, higher-level wrappers (AsyncWriterConnectionBufferedandAsyncWriterConnectionResumed) no longer need to trigger redundantQuery()calls to update their local tracking after a flush. This PR removes those duplicatedQuery()network calls and cleans up the resulting callback paths.