Repository: impala
Updated Branches:
  refs/heads/2.x 3d7d8209e -> 09962ad9d


IMPALA-6511: Fix state machine in FIS::UpdateState()

LAST_BATCH_SENT must always happen in state PRODUCING_DATA. This change
also marks "Open Finished" when receiving WAITING_FOR_FIRST_BATCH.

Change-Id: I7304205d245289cc3d7ca2217e212c844ee75e7b
Reviewed-on: http://gerrit.cloudera.org:8080/9294
Reviewed-by: Tim Armstrong <tarmstr...@cloudera.com>
Tested-by: Impala Public Jenkins


Project: http://git-wip-us.apache.org/repos/asf/impala/repo
Commit: http://git-wip-us.apache.org/repos/asf/impala/commit/fd067e43
Tree: http://git-wip-us.apache.org/repos/asf/impala/tree/fd067e43
Diff: http://git-wip-us.apache.org/repos/asf/impala/diff/fd067e43

Branch: refs/heads/2.x
Commit: fd067e43e7fa2954d6801ad8762c9d611add58b0
Parents: 3d7d820
Author: Lars Volker <l...@cloudera.com>
Authored: Mon Feb 12 18:27:32 2018 -0800
Committer: Impala Public Jenkins <impala-public-jenk...@gerrit.cloudera.org>
Committed: Wed Feb 14 00:53:39 2018 +0000

----------------------------------------------------------------------
 be/src/runtime/fragment-instance-state.cc | 7 ++-----
 tests/query_test/test_observability.py    | 1 +
 2 files changed, 3 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/impala/blob/fd067e43/be/src/runtime/fragment-instance-state.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/fragment-instance-state.cc 
b/be/src/runtime/fragment-instance-state.cc
index f36c91d..91b33a7 100644
--- a/be/src/runtime/fragment-instance-state.cc
+++ b/be/src/runtime/fragment-instance-state.cc
@@ -407,6 +407,7 @@ void FragmentInstanceState::UpdateState(const StateEvent 
event)
 
     case StateEvent::WAITING_FOR_FIRST_BATCH:
       DCHECK_EQ(current_state, TFInstanceExecState::WAITING_FOR_OPEN);
+      event_sequence_->MarkEvent("Open Finished");
       next_state = TFInstanceExecState::WAITING_FOR_FIRST_BATCH;
       break;
 
@@ -429,11 +430,7 @@ void FragmentInstanceState::UpdateState(const StateEvent 
event)
       break;
 
     case StateEvent::LAST_BATCH_SENT:
-      if (UNLIKELY(current_state == TFInstanceExecState::WAITING_FOR_OPEN)) {
-        event_sequence_->MarkEvent("Open Finished");
-      } else {
-        DCHECK_EQ(current_state, TFInstanceExecState::PRODUCING_DATA);
-      }
+      DCHECK_EQ(current_state, TFInstanceExecState::PRODUCING_DATA);
       next_state = TFInstanceExecState::LAST_BATCH_SENT;
       break;
 

http://git-wip-us.apache.org/repos/asf/impala/blob/fd067e43/tests/query_test/test_observability.py
----------------------------------------------------------------------
diff --git a/tests/query_test/test_observability.py 
b/tests/query_test/test_observability.py
index 9c0bb65..10ef6b2 100644
--- a/tests/query_test/test_observability.py
+++ b/tests/query_test/test_observability.py
@@ -189,6 +189,7 @@ class TestObservability(ImpalaTestSuite):
     instances, even when there are errors."""
     events = ["Fragment Instance Lifecycle Event Timeline",
               "Prepare Finished",
+              "Open Finished",
               "First Batch Produced",
               "First Batch Sent",
               "ExecInternal Finished"]

Reply via email to