Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4F4E3200D04 for ; Mon, 11 Sep 2017 23:46:12 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4E0391609C4; Mon, 11 Sep 2017 21:46:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 935C21609B7 for ; Mon, 11 Sep 2017 23:46:11 +0200 (CEST) Received: (qmail 4234 invoked by uid 500); 11 Sep 2017 21:46:10 -0000 Mailing-List: contact reviews-help@impala.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list reviews@impala.incubator.apache.org Received: (qmail 4223 invoked by uid 99); 11 Sep 2017 21:46:09 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 11 Sep 2017 21:46:09 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 6221E1A6655 for ; Mon, 11 Sep 2017 21:46:09 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.362 X-Spam-Level: X-Spam-Status: No, score=0.362 tagged_above=-999 required=6.31 tests=[RDNS_DYNAMIC=0.363, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id ZpRodBY7GJw9 for ; Mon, 11 Sep 2017 21:46:08 +0000 (UTC) Received: from ip-10-146-233-104.ec2.internal (ec2-75-101-130-251.compute-1.amazonaws.com [75.101.130.251]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 40AA95F1B3 for ; Mon, 11 Sep 2017 21:46:08 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by ip-10-146-233-104.ec2.internal (8.14.4/8.14.4) with ESMTP id v8BLk7EW029694; Mon, 11 Sep 2017 21:46:07 GMT Message-Id: <201709112146.v8BLk7EW029694@ip-10-146-233-104.ec2.internal> Date: Mon, 11 Sep 2017 21:46:07 +0000 From: "Lars Volker (Code Review)" To: impala-cr@cloudera.com, reviews@impala.incubator.apache.org CC: Joe McDonnell , Tim Armstrong , Dan Hecht Reply-To: lv@cloudera.com X-Gerrit-MessageType: comment Subject: =?UTF-8?Q?=5BImpala-ASF-CR=5D_IMPALA-5890=3A_Abort_queries_if_scanner_hits_IO_errors=0A?= X-Gerrit-Change-Id: I44dc95184c241fbcdbdbebad54339530680d3509 X-Gerrit-ChangeURL: X-Gerrit-Commit: 0b65109992b368d92e092026fcc0c1f0e2bc7f98 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Disposition: inline User-Agent: Gerrit/2.12.7 archived-at: Mon, 11 Sep 2017 21:46:12 -0000 Lars Volker has posted comments on this change. Change subject: IMPALA-5890: Abort queries if scanner hits IO errors ...................................................................... Patch Set 5: (5 comments) http://gerrit.cloudera.org:8080/#/c/8011/5/be/src/exec/base-sequence-scanner.cc File be/src/exec/base-sequence-scanner.cc: PS5, Line 177: if (status.IsCancelled() || status.IsMemLimitExceeded()) return status; : : // Log error from file format parsing. : state_->LogError(ErrorMsg(TErrorCode::SEQUENCE_SCANNER_PARSE_ERROR, : stream_->filename(), stream_->file_offset(), : (stream_->eof() ? "(EOF)" : ""))); : : // Make sure errors specified in the status are logged as well : state_->LogError(status.msg()); : : // If abort on error then return, otherwise try to recover. : if (state_->abort_on_error()) return status; : : // Abort scan range for I/O related errors : if (status.code() == TErrorCode::SCANNER_CONTEXT_WRAPPED_IO_ERROR) { : eos_ = true; : return Status::OK(); : } > it does seem like this could be written in terms of RuntimeState::LogOrRetu It looks to me as if the query will be aborted if return a non-OK status here. ProcessSplit() will return that status and it will be handled in hdfs-scan-node.cc:441. This will call SetDoneInternal() and the scanners will stop. Setting eos_ here will make stop ProcessSplit() but make it return Status::OK(). if (!status.ok()) { unique_lock l(lock_); // If there was already an error, the main thread will do the cleanup if (!status_.ok()) break; if (status.IsCancelled() && done_) { // Scan node initiated scanner thread cancellation. No need to do anything. break; } // Set status_ before calling SetDone() (which shuts down the RowBatchQueue), // to ensure that GetNextInternal() notices the error status. status_ = status; SetDoneInternal(); break; } That being said, I changed the code to abort the query. http://gerrit.cloudera.org:8080/#/c/8011/5/be/src/exec/scanner-context.cc File be/src/exec/scanner-context.cc: PS5, Line 194: Internal " > would be best to keep "Internal error" on the same line so that it's more e Done Line 284: io_buffer_bytes_left_ = 0; > Maybe add a short comment explaining why this is necessary? Done, thx for the suggestion. Line 371: Status wrapped_status(TErrorCode::SCANNER_CONTEXT_WRAPPED_IO_ERROR, status.msg().msg()); > Maybe reference IMPALA-4697 for context on why we're doing this instead of Removed the code altogether. http://gerrit.cloudera.org:8080/#/c/8011/5/be/src/exec/scanner-context.h File be/src/exec/scanner-context.h: Line 277: Status WrapIoError(const Status& status); > Is there a simple thing we can start with for this patch (rather than intro Done -- To view, visit http://gerrit.cloudera.org:8080/8011 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-MessageType: comment Gerrit-Change-Id: I44dc95184c241fbcdbdbebad54339530680d3509 Gerrit-PatchSet: 5 Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-Owner: Lars Volker Gerrit-Reviewer: Dan Hecht Gerrit-Reviewer: Joe McDonnell Gerrit-Reviewer: Lars Volker Gerrit-Reviewer: Tim Armstrong Gerrit-HasComments: Yes