[ 
https://issues.apache.org/jira/browse/IMPALA-15290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18117931#comment-18117931
 ] 

ASF subversion and git services commented on IMPALA-15290:
----------------------------------------------------------

Commit de51ad486dde94c7aea5d00da96acf9266afc6bf in impala's branch 
refs/heads/master from stiga-huang
[ https://gitbox.apache.org/repos/asf?p=impala.git;h=de51ad486 ]

IMPALA-15290: Retry for exists check in HadoopFsCommandLineClient

HadoopFsCommandLineClient.exists() currently ignores the stdout and
stderr of the hdfs CLI command. When it returns false, it could due to
transient errors like S3 503 Slow Down error. In such error cases,
stderr is not empty.

This adds a retry in exists() when the command exits with non-zero
status and non-empty stderr. Also adds logging to show stdout and stderr
for further debugging.

Testing
 - Ran test_execute_remove_orphan_files locally.
 - Ran tests/query_test/test_iceberg.py on S3.

Assisted-by: Opus 4.8 (Claude Code)
Change-Id: I071472529ec1b923e74e960a24e19b9e70c80011
Reviewed-on: http://gerrit.cloudera.org:8080/24744
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>


> test_execute_remove_orphan_files fails in file existence check
> --------------------------------------------------------------
>
>                 Key: IMPALA-15290
>                 URL: https://issues.apache.org/jira/browse/IMPALA-15290
>             Project: IMPALA
>          Issue Type: Bug
>            Reporter: Quanlong Huang
>            Priority: Major
>
> Stacktrace
> {noformat}
> query_test/test_iceberg.py:502: in test_execute_remove_orphan_files
>     assert self.filesystem_client.exists(os.path.join(DATA_PATH, file_parq1))
> E   AssertionError: assert False
> E    +  where False = <bound method HadoopFsCommandLineClient.exists of 
> <tests.util.hdfs_util.HadoopFsCommandLineClient object at 
> 0x7fd3a9a06d10>>('/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files/data/00000-0-data-gfurnstahl_20220906113044_157fc172-f5d3-4c70-8653-fff150b6136a-job_16619542960420_0002-1-00001.parquet')
> E    +    where <bound method HadoopFsCommandLineClient.exists of 
> <tests.util.hdfs_util.HadoopFsCommandLineClient object at 0x7fd3a9a06d10>> = 
> <tests.util.hdfs_util.HadoopFsCommandLineClient object at 
> 0x7fd3a9a06d10>.exists
> E    +      where <tests.util.hdfs_util.HadoopFsCommandLineClient object at 
> 0x7fd3a9a06d10> = <test_iceberg.TestIcebergTable object at 
> 0x7fd3a98e8950>.filesystem_client
> E    +    and   
> '/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files/data/00000-0-data-gfurnstahl_20220906113044_157fc172-f5d3-4c70-8653-fff150b6136a-job_16619542960420_0002-1-00001.parquet'
>  = <function join at 
> 0x7fd3b6e34f40>('/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files/data',
>  
> '00000-0-data-gfurnstahl_20220906113044_157fc172-f5d3-4c70-8653-fff150b6136a-job_16619542960420_0002-1-00001.parquet')
> E    +      where <function join at 0x7fd3b6e34f40> = <module 'posixpath' 
> (frozen)>.join
> E    +        where <module 'posixpath' (frozen)> = os.path
>         DATA_PATH  = 
> '/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files/data'
>         METADATA_PATH = 
> '/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files/metadata'
>         SRC_DIR    = 
> '/data/jenkins/workspace/impala-asf-master-core-s3-data-cache/repos/Impala/testdata/data/iceberg_test/iceberg_mixed_file_format_test/{0}/{1}'
>         TABLE_PATH = 
> '/test-warehouse/test_execute_remove_orphan_files_1e8edd5.db/tbl_with_orphan_files'
>         db_tbl     = 
> 'test_execute_remove_orphan_files_1e8edd5.tbl_with_orphan_files'
>         file_avro1 = '055baf62-de6d-4583-bf21-f187f9482343-m0.avro'
>         file_parq1 = 
> '00000-0-data-gfurnstahl_20220906113044_157fc172-f5d3-4c70-8653-fff150b6136a-job_16619542960420_0002-1-00001.parquet'
>         impalad_client = <tests.common.impala_connection.ImpylaHS2Connection 
> object at 0x7fd3a9aa06d0>
>         insert_q   = 'insert into {0} values ({1})'
>         result     = <tests.common.impala_connection.ImpylaHS2ResultSet 
> object at 0x7fd3a9aa3590>
>         self       = <test_iceberg.TestIcebergTable object at 0x7fd3a98e8950>
>         tbl_name   = 'tbl_with_orphan_files'
>         unique_database = 'test_execute_remove_orphan_files_1e8edd5'{noformat}
> The code is:
> {code:python}
>  494       # Copy first set of junk files.
>  495       file_parq1 = 
> "00000-0-data-gfurnstahl_20220906113044_157fc172-f5d3-4c70-8653-" \
>  496           "fff150b6136a-job_16619542960420_0002-1-00001.parquet"
>  497       file_avro1 = "055baf62-de6d-4583-bf21-f187f9482343-m0.avro"
>  498       self.filesystem_client.copy_from_local(
>  499           SRC_DIR.format('data', file_parq1), DATA_PATH)
>  500       self.filesystem_client.copy_from_local(
>  501           SRC_DIR.format('metadata', file_avro1), METADATA_PATH)
>  502       assert self.filesystem_client.exists(os.path.join(DATA_PATH, 
> file_parq1))
>  503       assert self.filesystem_client.exists(os.path.join(METADATA_PATH, 
> file_avro1)){code}
> https://github.com/apache/impala/blob/2157bc8278dd9db8dcb7dc77d982919a9d61f4b0/tests/query_test/test_iceberg.py#L502



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to