Impala Public Jenkins has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/18801 )
Change subject: IMPALA-11464: Skip listing staging dirs to avoid failures on them ...................................................................... IMPALA-11464: Skip listing staging dirs to avoid failures on them Hive or other systems will generate staging/tmp dirs under the table/partition folders while loading/inserting data. They are removed when the operation is done. File metadata loading in catalogd could fail if it's listing files of such dirs. This is found on HDFS where file listing is done in batches. Each batch contains a partial list of 1000 items (configured by "dfs.ls.limit"). If the dir is removed, the next listing, e.g. the next hasNext() call on the RemoteIterator, will fail with FileNotFoundException. Such error on staging/tmp dirs should not fail the metadata loading. However, if it happens on a partition dir, the metadata loading should fail to avoid stale metadata. This patch adds a check before listing the dir. If it's a staging/tmp dir, catalogd will just ignore it. Also adds a debug action, catalogd_pause_after_hdfs_remote_iterator_creation, to inject sleeps after the first partial listing (happens in creating the RemoteIterator). So we can reproduce the FileNotFoundException stably. Tests: - Add test on removing a large staging dir (contains 1024 files) during REFRESH. Metadata loading fails consistently before this fix. - Add test on removing a large partition dir (contains 1024 files) during REFRESH. Verify metadata loading fails as expected. Change-Id: Ic848e6c8563a1e0bf294cd50167dfc40f66a56cb Reviewed-on: http://gerrit.cloudera.org:8080/18801 Reviewed-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Tested-by: Impala Public Jenkins <impala-public-jenk...@cloudera.com> --- M fe/src/main/java/org/apache/impala/common/FileSystemUtil.java M fe/src/main/java/org/apache/impala/util/DebugUtils.java M tests/metadata/test_recursive_listing.py M tests/util/filesystem_base.py M tests/util/hdfs_util.py 5 files changed, 150 insertions(+), 10 deletions(-) Approvals: Impala Public Jenkins: Looks good to me, approved; Verified -- To view, visit http://gerrit.cloudera.org:8080/18801 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Ic848e6c8563a1e0bf294cd50167dfc40f66a56cb Gerrit-Change-Number: 18801 Gerrit-PatchSet: 7 Gerrit-Owner: Quanlong Huang <huangquanl...@gmail.com> Gerrit-Reviewer: Csaba Ringhofer <csringho...@cloudera.com> Gerrit-Reviewer: Daniel Becker <daniel.bec...@cloudera.com> Gerrit-Reviewer: Impala Public Jenkins <impala-public-jenk...@cloudera.com> Gerrit-Reviewer: Kurt Deschler <kdesc...@cloudera.com> Gerrit-Reviewer: Quanlong Huang <huangquanl...@gmail.com> Gerrit-Reviewer: Xiang Yang <yx91...@126.com>