-
Notifications
You must be signed in to change notification settings - Fork 386
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: reload pipeline config independently #1713
base: main
Are you sure you want to change the base?
Conversation
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.
配置变更的时候是先init新的,然后stop老的,再start新的,目前看代码里是不支持这种模式的
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.
以下接口已经废弃,直接移除:ProcessRawLog、ProcessRawLogV2、ProcessLog(C++ observer代码有依赖,但是observer也会整体废除,所以可以不用管)
plugin_main/plugin_export.go
Outdated
@@ -134,10 +133,6 @@ func LoadGlobalConfig(jsonStr string) int { | |||
//export LoadConfig | |||
func LoadConfig(project string, logstore string, configName string, logstoreKey int64, jsonStr string) int { |
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.
这个接口需要从长计议,logstorekey这个肯定不能要,但是Go流水线需要知道是不是要往C++发送,所以这个信息也是需要放到Go的GlobalConfig里的。flusher的IsReady函数需要进行修改,理论上不应该传logstorekey,而应该传configname
if (HasContext()) { | ||
unique_ptr<SenderQueueItem> tombStone = make_unique<SenderQueueItem>("", 0, this, mQueueKey); | ||
tombStone->mPipeline = PipelineManager::GetInstance()->FindConfigByName(mContext->GetConfigName()); | ||
if (!tombStone->mPipeline) { | ||
LOG_ERROR(sLogger, ("failed to find pipeline when stop flusher", mContext->GetConfigName())); | ||
} | ||
SenderQueueManager::GetInstance()->PushQueue(mQueueKey, std::move(tombStone)); | ||
} |
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.
这里的实现肯定不对,要是这么简单当时就这么弄了,去看一下senderqueue的实现,想一想这么写能保证tombstone在所有item之后再pop吗
@@ -2841,6 +2853,29 @@ void PipelineUnittest::TestFlushBatch() const { | |||
} | |||
} | |||
|
|||
void PipelineUnittest::TestInProcessingCount() const { |
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.
UT很弱,没有什么针对性的用例
@@ -37,37 +36,36 @@ using namespace std; | |||
|
|||
namespace logtail { | |||
|
|||
PipelineManager::PipelineManager() | |||
: mInputRunners({ | |||
PrometheusInputRunner::GetInstance(), |
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.
最后一个元素有逗号应该不影响
背景
目前加载配置都是全量停止,全量重新加载和全量启动。这会造成一些没有变化的配置的重复加载。使得转发类和抓取类Input的流水线出现采集中断
方案
C++
重新实现了加载逻辑,不会在加载配置前停止所有流水线,按照如下的顺序,独立加载
Go
修改了CGO接口,提供了新的Go流水线加载接口,命名与C++侧统一。