impl(bigtable): improve query execution refresh and retry#15788
impl(bigtable): improve query execution refresh and retry#15788scotthart merged 2 commits intogoogleapis:mainfrom
Conversation
Summary of ChangesHello @scotthart, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly improves the robustness and clarity of Bigtable's query execution by enhancing its query plan refresh and retry mechanisms. It introduces a more granular approach to handling transient errors during query plan refreshes and centralizes the refresh logic within a dedicated class. These changes lead to a more resilient system, better organized code, and expanded test coverage for Bigtable's Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request significantly improves the query execution and retry logic. The introduction of the QueryPlanRefreshingPartialResultSource class is a great refactoring that encapsulates the complex logic for handling query plan refreshes, making the ExecuteQuery method much cleaner. The renaming of various policies and traits for clarity, and the addition of a separate retry policy for the query plan refresh function, are also welcome improvements. The changes look solid and improve the robustness and maintainability of the code. I have a couple of minor suggestions for improving code style and consistency.
| } | ||
| last_status = source.status(); | ||
|
|
||
| if (IsStatusIndicatingInternalError(source.status())) { |
There was a problem hiding this comment.
I suspected there was a better place for this check. How is it being handled now?
There was a problem hiding this comment.
It's part of the different Retry traits defined in retry_traits.h. Unfortunately, refreshing query plans as part of streaming the query results requires a total of 3 different retry traits depending on what operation is occurring.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15788 +/- ##
==========================================
- Coverage 92.94% 92.94% -0.01%
==========================================
Files 2454 2454
Lines 226878 226946 +68
==========================================
+ Hits 210879 210933 +54
- Misses 15999 16013 +14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
QueryPlanRefreshFunctionRetry, for query plan refresh attempts which have a broader definition of transient errors.QueryPlanRefreshRetrytoExecuteQueryPlanRefreshRetryto be more precise and differentiate it fromQueryPlanRefreshFunctionRetry.QueryPlanRefreshingPartialResultSource, that handles the query plan refresh logic and recreating thePartialResultSourceif necessary depending on when in the stream creation/processing the query plan refresh is indicated.PartialResultSetSouce::resume_token_documentation to match Bigtable implementation.