impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Internal Jenkins (Code Review)" <ger...@cloudera.org>
Subject [Impala-ASF-CR] IMPALA-4580: Fix crash with FETCH FIRST when #rows < result cache size
Date Sat, 03 Dec 2016 11:07:04 GMT
Internal Jenkins has submitted this change and it was merged.

Change subject: IMPALA-4580: Fix crash with FETCH_FIRST when #rows < result cache size
......................................................................


IMPALA-4580: Fix crash with FETCH_FIRST when #rows < result cache size

The following sequence can lead to a crash:

  1. Client sets result cache size to N
  2. Client issues query with #results < N
  3. Client fetches all results, triggering eos and tearing down
     Coordinator::root_sink_.
  4. Client restarts query with FETCH_FIRST.
  5. Client reads all results again. After cache is exhausted,
     Coordinator::GetNext() is called to detect eos condition again.
  6. GetNext() hits DCHECK(root_sink_ != nullptr).

This patch makes GetNext() a no-op if called after it sets *eos,
avoiding the crash..

Testing:
  Regression test that triggered the bug before this fix.

Change-Id: I454cd8a6cf438bdd0c49fd27c2725d8f6c43bb1d
Reviewed-on: http://gerrit.cloudera.org:8080/5335
Reviewed-by: Henry Robinson <henry@cloudera.com>
Reviewed-by: Dan Hecht <dhecht@cloudera.com>
Tested-by: Internal Jenkins
---
M be/src/runtime/coordinator.cc
M be/src/runtime/coordinator.h
M tests/hs2/test_fetch_first.py
3 files changed, 39 insertions(+), 2 deletions(-)

Approvals:
  Henry Robinson: Looks good to me, approved
  Internal Jenkins: Verified
  Dan Hecht: Looks good to me, approved



-- 
To view, visit http://gerrit.cloudera.org:8080/5335
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I454cd8a6cf438bdd0c49fd27c2725d8f6c43bb1d
Gerrit-PatchSet: 3
Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-Owner: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Dan Hecht <dhecht@cloudera.com>
Gerrit-Reviewer: Henry Robinson <henry@cloudera.com>
Gerrit-Reviewer: Internal Jenkins

Mime
View raw message