This is an automated email from the ASF dual-hosted git repository.

michaelsmith pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit f826f7212438604990fa707315195d77b3bf2a5d
Author: Csaba Ringhofer <[email protected]>
AuthorDate: Tue May 2 16:17:40 2023 +0200

    IMPALA-10585: Only retry SELECT queries
    
    Before this patch if retry_failed_queries=1 then DML queries were
    also retried if there were failed backends. This was not handled
    correctly in the coordinator and could lead to:
    - duplicate rows for external tables
    - incorrect transaction handling for Hive ACID tables
    
    Testing is also missing for DMLs + retry_failed_queries.
    
    This is a quick fix that disables retrying non-select statements.
    Followup commits can add more sophisticated handling and tests.
    
    Testing:
    - manually checked that INSERTs are not retried
    
    Change-Id: I7a0ae7994ad1dc82bfb5989c924c95b66ff81b81
    Reviewed-on: http://gerrit.cloudera.org:8080/19830
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Michael Smith <[email protected]>
---
 be/src/runtime/query-driver.cc | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/be/src/runtime/query-driver.cc b/be/src/runtime/query-driver.cc
index 0c9001dca..954ddd085 100644
--- a/be/src/runtime/query-driver.cc
+++ b/be/src/runtime/query-driver.cc
@@ -129,6 +129,12 @@ void QueryDriver::TryQueryRetry(
   if (exec_request_->query_options.retry_failed_queries) {
     lock_guard<mutex> l(*client_request_state->lock());
 
+    if (client_request_state->stmt_type() != TStmtType::QUERY) {
+      // Retrying DML queries would be useful but currently it is
+      // buggy / untested (see IMPALA-10585).
+      return;
+    }
+
     // Queries can only be retried if no rows for the query have been fetched
     // (IMPALA-9225).
     if (client_request_state->fetched_rows()) {

Reply via email to