IMPALA-5198: Error messages are sometimes dropped before reaching client

The Status::ToThrift() function takes the ErrorMsg, and pushes both
the msg() and details() into the TStatus::error_msgs list.

However, when we unpack the TStatus object into a Status object, we
just copy all the TStatus::error_msgs to Status::ErrorMsg::details_
and leave Status::ErrorMsg::message_ blank.

This led to the error message not being printed in certain cases which
is now fixed.

The PlanFragmentExecutor had some code to add query statuses to
the error_log (IMP-633), which is no longer necessary after a
future patch (IMPALA-762) explicitly returned the query status to
the client via get_log(), making the adding of the query statuses
to the error_log redundant. That code in the PFE has been removed
and a test has been added to make sure that the case it previously
tried to fix doesn't regress.

Change-Id: I5d9d63610eb0d2acae3a9303ce46e1410727ce87
Reviewed-on: http://gerrit.cloudera.org:8080/6627
Reviewed-by: Sailesh Mukil <sailesh@cloudera.com>
Tested-by: Impala Public Jenkins
This commit is contained in:
Sailesh Mukil
2017-04-12 23:53:42 -07:00
committed by Impala Public Jenkins
parent fb2a78567a
commit e0d1db51ed
5 changed files with 51 additions and 20 deletions

View File

@@ -22,6 +22,7 @@
import pytest
import random
from tests.beeswax.impala_beeswax import ImpalaBeeswaxException
from tests.common.impala_test_suite import ImpalaTestSuite
from tests.common.skip import SkipIfS3, SkipIfLocal
from tests.common.test_dimensions import create_exec_option_dimension
@@ -41,6 +42,27 @@ class TestDataErrors(ImpalaTestSuite):
def get_workload(self):
return 'functional-query'
# Regression test for IMP-633. Added as a part of IMPALA-5198
class TestHdfsFileOpenFailErrors(ImpalaTestSuite):
@pytest.mark.execute_serially
def test_hdfs_file_open_fail(self):
absolute_location = "/test-warehouse/file_open_fail"
create_stmt = \
"create table file_open_fail (x int) location '" + absolute_location + "'"
insert_stmt = "insert into file_open_fail values(1)"
select_stmt = "select * from file_open_fail"
drop_stmt = "drop table if exists file_open_fail purge"
self.client.execute(drop_stmt)
self.client.execute(create_stmt)
self.client.execute(insert_stmt)
self.filesystem_client.delete_file_dir(absolute_location, recursive=True)
assert not self.filesystem_client.exists(absolute_location)
try:
self.client.execute(select_stmt)
except ImpalaBeeswaxException as e:
assert "Failed to open HDFS file" in str(e)
self.client.execute(drop_stmt)
@SkipIfS3.qualified_path
class TestHdfsScanNodeErrors(TestDataErrors):
@@ -59,7 +81,6 @@ class TestHdfsScanNodeErrors(TestDataErrors):
pytest.xfail("Expected results differ across file formats")
self.run_test_case('DataErrorsTest/hdfs-scan-node-errors', vector)
@SkipIfS3.qualified_path
@SkipIfLocal.qualified_path
class TestHdfsSeqScanNodeErrors(TestHdfsScanNodeErrors):