Skip to content
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

Closed
Minnull opened this issue Feb 9, 2023 · 3 comments
Closed

Comments

@Minnull
Copy link

Minnull commented Feb 9, 2023

问题定位
代码位置: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变量,是基于什么规范考虑的吗?

@Nicole00
Copy link
Contributor

问题定位 代码位置: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变量,是基于什么规范考虑的吗?

感谢提出。 关于为什么catch到异常后不直接抛出,是因为抛出异常的话整个app会终止,如果用于记录,后续的数据可以继续写入sst,同时通过batchFailure 把写入失败的情况告诉用户。 这里当batchFailure>0时存在数据不完整的情况,也需要再考虑下是否允许此种情况。

关于您的建议,对于sst模式来说完全可以,很赞同。 对于client模式,因为有个重试的过程,就不能根据batchFailure来判定是否要正常退出了,也要记录重试的结果。之前的考虑是 导入逻辑是否成功根据batchSuccess和batchFailure来判断,spark退出的状态只展示app的运行状态。

@Minnull
Copy link
Author

Minnull commented Feb 23, 2023

感谢解答

@QingZ11
Copy link

QingZ11 commented Mar 30, 2023

@Minnull 🤔 我看问题差不多解决了,这边先行关闭 issue 了。如果你有任何问题,可以重新提 issue 哈,谢谢反馈😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants