-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
write sst模式遇到Throwable问题时,任务的退出状态仍为成功 #125
Comments
感谢提出。 关于为什么catch到异常后不直接抛出,是因为抛出异常的话整个app会终止,如果用于记录,后续的数据可以继续写入sst,同时通过batchFailure 把写入失败的情况告诉用户。 这里当batchFailure>0时存在数据不完整的情况,也需要再考虑下是否允许此种情况。 关于您的建议,对于sst模式来说完全可以,很赞同。 对于client模式,因为有个重试的过程,就不能根据batchFailure来判定是否要正常退出了,也要记录重试的结果。之前的考虑是 导入逻辑是否成功根据batchSuccess和batchFailure来判断,spark退出的状态只展示app的运行状态。 |
感谢解答 |
@Minnull 🤔 我看问题差不多解决了,这边先行关闭 issue 了。如果你有任何问题,可以重新提 issue 哈,谢谢反馈😊 |
问题定位
代码位置:https://github.com/vesoft-inc/nebula-exchange/blob/master/exchange-common/src/main/scala/com/vesoft/exchange/common/writer/FileBaseWriter.scala
112行
分析代码逻辑
} catch { case e: Throwable => { LOG.error("sst file write error,", e) batchFailure.add(1) } }
这里spark任务在executor里执行的时候,如果遇到了Throwable,则把错误数记录在了batchFailure变量上,不进行其他处理。
最终状态,spark会变成执行成功,但是sst没有写成功。
待修复问题
(1)这里会导致丢数据的问题。我认为可以增加修复逻辑:在driver进行校验,如果batchFailure>0时,则把spark退出状态修改为非正常退出。
学习咨询
(1)为什么catch到异常的时候不直接继续抛出异常,让spark的executor重试3次之后,把任务整体会变成失败。而是把错误记录在了batchFailure变量,是基于什么规范考虑的吗?
The text was updated successfully, but these errors were encountered: