IMPALA-4437: hit DCHECK in buffered-block-mgr-test

The issue was introduced by "IMPALA-3202: DiskIoMgr improvements
for new buffer pool". The bug is pretty straightforward - I forgot
to update some error/cancellation paths to handle client-provided
buffers.

Testing:
Was able to reproduce locally before the fix, have run it in a loop for
a while with the fix and not seen any crashes.

Change-Id: Ib7e8ffdbec341f6ffbc310fb29df63ab45fed545
Reviewed-on: http://gerrit.cloudera.org:8080/4973
Reviewed-by: Henry Robinson <[email protected]>
Tested-by: Internal Jenkins


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

Branch: refs/heads/master
Commit: 58d8861c58fd911411fdb61a4c2c850dc86d9803
Parents: 822b2ca
Author: Tim Armstrong <[email protected]>
Authored: Sun Nov 6 19:15:39 2016 -0800
Committer: Internal Jenkins <[email protected]>
Committed: Mon Nov 7 11:50:43 2016 +0000

----------------------------------------------------------------------
 be/src/runtime/disk-io-mgr.cc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/58d8861c/be/src/runtime/disk-io-mgr.cc
----------------------------------------------------------------------
diff --git a/be/src/runtime/disk-io-mgr.cc b/be/src/runtime/disk-io-mgr.cc
index 7c5620a..265b49a 100644
--- a/be/src/runtime/disk-io-mgr.cc
+++ b/be/src/runtime/disk-io-mgr.cc
@@ -980,7 +980,7 @@ void DiskIoMgr::HandleReadFinished(DiskQueue* disk_queue, 
DiskIoRequestContext*
   if (reader->state_ == DiskIoRequestContext::Cancelled) {
     state.DecrementRequestThreadAndCheckDone(reader);
     DCHECK(reader->Validate()) << endl << reader->DebugString();
-    FreeBufferMemory(buffer);
+    if (!buffer->is_client_buffer()) FreeBufferMemory(buffer);
     buffer->scan_range_->Cancel(reader->status_);
     // Enqueue the buffer to use the scan range's buffer cleanup path.
     buffer->scan_range_->EnqueueBuffer(buffer);
@@ -996,7 +996,7 @@ void DiskIoMgr::HandleReadFinished(DiskQueue* disk_queue, 
DiskIoRequestContext*
   //  3. Middle of scan range
   if (!buffer->status_.ok()) {
     // Error case
-    FreeBufferMemory(buffer);
+    if (!buffer->is_client_buffer()) FreeBufferMemory(buffer);
     buffer->eosr_ = true;
     --state.num_remaining_ranges();
     buffer->scan_range_->Cancel(buffer->status_);

Reply via email to