Velox 后端故障排查
故障排查
抛出原生异常后发生致命错误
我们依赖检查从原生代码抛出的异常,以验证 Spark 计划是否真的可以下推到原生引擎执行。但如果安装了 libunwind-dev,原生异常将不会被捕获,从而中断程序。到目前为止,我们观察到这种致命错误仅在 Ubuntu 20.04 上出现。请移除 libunwind-dev 并重新构建项目以解决此问题。
sudo apt-get purge --auto-remove libunwind-dev
Jar 冲突问题
使用最新版本的 Gluten,应该不会再出现 jar 冲突问题。如果你仍然遇到此类问题,请按照以下说明操作。
可能产生冲突的库包括 protobuf(Velox 和 CK 后端均涉及)、flatbuffers(Velox 后端)以及 arrow-*(Velox 后端)。这些库均从源码编译并打包进 Gluten 的 jar 中。JVM 应当优先从 Gluten.jar 中查找并加载它们,但由于某些原因,JVM 却从 spark_home/jars 中加载了这些 jar,从而导致冲突。你可以使用以下命令从 spark_home/jars 中移除这些 jar。我们仍在调查根本原因,欢迎分享你的解决方案。
rm -rf $SPARK_HOME/jars/protobuf-*
# velox backend only
rm -rf $SPARK_HOME/jars/flatbuffers-*
rm -rf $SPARK_HOME/jars/arrow-*使用原生写入器时出现类不兼容错误
Gluten 原生写入器会覆盖部分原生 Spark 类。因此,在运行使用 Gluten 的程序时,必须确保 Gluten 的 jar 先于原生 Spark 的 jar 被加载。本节将提供 $SPARK_HOME/conf/spark-defaults.conf 中的一些配置项,分别适用于 Yarn Client、Yarn Cluster 以及 Local&Standalone 模式,以保证 Gluten 的 jar 优先加载。
Yarn Client 模式下的配置
// spark will upload the gluten jar to hdfs and then the nodemanager will fetch the gluten jar before start the executor process. Here also can set the spark.jars.
spark.files=<absolute_path_to_Gluten_JAR>
// The absolute path on running node
spark.driver.extraClassPath=<absolute_path_to_Gluten_JAR>
// The relative path under the executor working directory
spark.executor.extraClassPath=./<Gluten_JAR>Yarn Cluster 模式的配置
spark.driver.userClassPathFirst=true
spark.executor.userClassPathFirst=true
spark.files=<absolute_path_to_Gluten_JAR>
// The relative path under the executor working directory
spark.driver.extraClassPath=./<Gluten_JAR>
// The relative path under the executor working directory
spark.executor.extraClassPath=./<Gluten_JAR>本地与独立模式的配置
// The absolute path on running node
spark.driver.extraClassPath=<absolute_path_to_Gluten_JAR>
// The absolute path on running node
spark.executor.extraClassPath=<absolute_path_to_Gluten_JAR>无效指针错误
如果运行时报告了以下错误,请使用 --compile_arrow_java=ON 重新构建 Gluten,然后重新部署 Gluten jar。
*** Error in `/usr/local/jdk1.8.0_381/bin/java': free(): invalid pointer: 0x00007f36cb5cec80 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7d1fd)[0x7f38c29da1fd]
/lib64/libstdc++.so.6(_ZNSt6locale5_Impl16_M_install_facetEPKNS_2idEPKNS_5facetE+0x142)[0x7f36cb3370d2]
/lib64/libstdc++.so.6(_ZNSt6locale5_ImplC1Em+0x1e3)[0x7f36cb337523]
/lib64/libstdc++.so.6(+0x71495)[0x7f36cb338495]
/lib64/libpthread.so.0(pthread_once+0x50)[0x7f38c3147be0]
/lib64/libstdc++.so.6(+0x714e1)[0x7f36cb3384e1]
/lib64/libstdc++.so.6(_ZNSt6localeC2Ev+0x13)[0x7f36cb338523]
/lib64/libstdc++.so.6(_ZNSt8ios_base4InitC2Ev+0xbc)[0x7f36cb33537c]
/tmp/jnilib-645156599284574767.tmp(+0x2a90)[0x7f375d235a90]
/lib64/ld-linux-x86-64.so.2(+0xf4e3)[0x7f38c33664e3]
/lib64/ld-linux-x86-64.so.2(+0x13b04)[0x7f38c336ab04]
/lib64/ld-linux-x86-64.so.2(+0xf2f4)[0x7f38c33662f4]
/lib64/ld-linux-x86-64.so.2(+0x1321b)[0x7f38c336a21b]
/lib64/libdl.so.2(+0x102b)[0x7f38c2d1f02b]
/lib64/ld-linux-x86-64.so.2(+0xf2f4)[0x7f38c33662f4]
/lib64/libdl.so.2(+0x162d)[0x7f38c2d1f62d]
/lib64/libdl.so.2(dlopen+0x31)[0x7f38c2d1f0c1]
/usr/local/jdk1.8.0_381/jre/lib/amd64/server/libjvm.so(+0x9292b1)[0x7f38c22732b1]
/usr/local/jdk1.8.0_381/jre/lib/amd64/server/libjvm.so(JVM_LoadLibrary+0xa1)[0x7f38c205e0c1]
/usr/local/jdk1.8.0_381/jre/lib/amd64/libjava.so(Java_java_lang_ClassLoader_00024NativeLibrary_load+0x1ac)
...评论
登录后参与评论
KnowForge