You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@impala.apache.org by ta...@apache.org on 2020/06/23 04:20:25 UTC

[impala] branch master updated: IMPALA-9866: Query plan debug page stuck in fetch and render loop.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new dcf0fe4  IMPALA-9866: Query plan debug page stuck in fetch and render loop.
dcf0fe4 is described below

commit dcf0fe43bc31bdbc845b992d64197fad38fc079b
Author: Shant Hovsepian <sh...@cloudera.com>
AuthorDate: Wed Jun 17 22:48:28 2020 -0400

    IMPALA-9866: Query plan debug page stuck in fetch and render loop.
    
    Once a query is completed we stop fetching and rendering the plan. This
    speeds interaction with large query plans in the web browser as well as
    reduces some load on the query coordinator.
    
    Change-Id: Ie1f233c90d5f221813833af2e29be2250936d442
    Reviewed-on: http://gerrit.cloudera.org:8080/16092
    Reviewed-by: Impala Public Jenkins <im...@cloudera.com>
    Tested-by: Impala Public Jenkins <im...@cloudera.com>
---
 be/src/service/impala-http-handler.cc | 2 ++
 www/query_plan.tmpl                   | 8 ++++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/be/src/service/impala-http-handler.cc b/be/src/service/impala-http-handler.cc
index 197100d..5144345 100644
--- a/be/src/service/impala-http-handler.cc
+++ b/be/src/service/impala-http-handler.cc
@@ -928,6 +928,8 @@ void ImpalaHttpHandler::QuerySummaryHandler(bool include_json_plan, bool include
   document->AddMember("stmt", json_stmt, document->GetAllocator());
   Value json_plan_text(RedactCopy(plan).c_str(), document->GetAllocator());
   document->AddMember("plan", json_plan_text, document->GetAllocator());
+  Value json_inflight(found);
+  document->AddMember("inflight", json_inflight, document->GetAllocator());
 
   // Redact the error in case the query is contained in the error message.
   Value json_status(query_status.ok() ? "OK" :
diff --git a/www/query_plan.tmpl b/www/query_plan.tmpl
index c677e90..744eb69 100644
--- a/www/query_plan.tmpl
+++ b/www/query_plan.tmpl
@@ -57,7 +57,7 @@ under the License.
 <h3>Plan</h3>
 <div>
   <label>
-  <input type="checkbox" checked="true" id="colour_scheme"/>
+  <input type="checkbox" checked="true" id="colour_scheme" onClick="refresh()"/>
   Shade nodes according to time spent (if unchecked, shade according to plan fragment)
   </label>
 </div>
@@ -137,6 +137,10 @@ function renderGraph(ignored_arg) {
   if (req.status != 200) return;
   var json = JSON.parse(req.responseText);
   var plan = json["plan_json"];
+  var inflight = json["inflight"];
+  if (!inflight) {
+    clearInterval(intervalId);
+  }
 
   var states = []
   var edges = []
@@ -222,6 +226,6 @@ function refresh() {
 // Force one refresh before starting the timer.
 refresh();
 
-setInterval(refresh, 1000);
+var intervalId = setInterval(refresh, 2000);
 
 </script>