impala-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Henry Robinson (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 00:31:50 GMT
Hello Dan Hecht,

I'd like you to reexamine a change.  Please visit

    http://gerrit.cloudera.org:8080/5335

to look at the new patch set (#2).

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
---
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(-)


  git pull ssh://gerrit.cloudera.org:29418/Impala-ASF refs/changes/35/5335/2
-- 
To view, visit http://gerrit.cloudera.org:8080/5335
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

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

Mime
View raw message