-
Notifications
You must be signed in to change notification settings - Fork 399
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
feat: add full_drain_mode option to ensure complete data flush over network before shutdown #1395
Conversation
core/sender/Sender.cpp
Outdated
@@ -2073,7 +2073,7 @@ SendResult Sender::SendToNetSync(sdk::Client* sendClient, | |||
void Sender::SendToNetAsync(LoggroupTimeValue* dataPtr) { | |||
auto& exactlyOnceCpt = dataPtr->mLogGroupContext.mExactlyOnceCheckpoint; | |||
|
|||
if (IsFlush()) // write local file avoid binary update fail | |||
if (!BOOL_FLAG(sidecar_mode) && Application::GetInstance()->IsExiting()) // write local file avoid binary update fail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果网络不稳定,发送极慢,会有什么影响?影响最终退出时间?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
常规模式下,一旦开始退出流程,所有缓存队列的数据全部写到本地磁盘,不再通过网络发送,所以网络对退出时间无影响;
新模式下,是强制发完所有数据后退出,如果网络问题导致发不出去,就会一直等着,直到K8s强制kill。这个是迅飞提的要求,发不出去就死等,而不是超时自动退出。
if (BOOL_FLAG(sidecar_mode) && Application::GetInstance()->IsExiting() | ||
&& EventDispatcher::GetInstance()->IsAllFileRead()) { | ||
break; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
非sidecar_mode在mInteruptFlag+Application::GetInstance()->IsExiting()的时候也可以break出来?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
之前的设计里是input的循环是不会主动退出的,只会暂停
Introducing the full_drain_mode configuration, which when enabled, triggers a comprehensive data flush across the network during the shutdown sequence. This mode is particularly beneficial for environments with sidecar and fat containers where data persistence is not guaranteed post-application exit. By ensuring all data is transmitted prior to shutdown, we prevent potential data loss that could occur with local dumps, making this feature a critical addition for systems that require high data integrity and resilience.