[1928-a3] feat(config): remove input whitelist transitional constraints#2642
Draft
Takuka0311 wants to merge 6 commits into
Draft
[1928-a3] feat(config): remove input whitelist transitional constraints#2642Takuka0311 wants to merge 6 commits into
Takuka0311 wants to merge 6 commits into
Conversation
Remove the input-type whitelist/blacklist gate introduced as a transitional bridge in A1 (alibaba#2596). Any registered native input may now coexist with Go processors and/or Go flushers, realizing "no more Input-type whitelist" (Discussion alibaba#1928, step A3). A2 (alibaba#2597) already ensures native inputs produce proper C++ events, making this safe. - drop GetNativeInputBlacklistWhenUsingGoPlugin / IsNativeInputBlockedWhenUsingGoPlugin and the hasFileInput branches; remove the "more than 1 input_file" single-input constraint so multiple native file inputs may coexist - clarify the Native + Go multi-flusher coexistence rule (kept intentionally: only flusher_sls can currently be fed by the Go pipeline) with a forward reference to the B-line FlusherV2.Export work - CollectionPipeline: capture the file-input pointer via mInputs.back() instead of mInputs[0] so detection is correct when a file input is not first - update/add UTs: NativeInputWithGoPlugin now asserts default-allow; MultiInputAndFlusherCoexistence covers multi input_file + flusher_sls and the Native+Go multi-flusher rule (success and failure paths) Does not change the default StructureType. Closes alibaba#2600 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Takuka0311
commented
Jul 7, 2026
Takuka0311
commented
Jul 7, 2026
Takuka0311
commented
Jul 7, 2026
Takuka0311
commented
Jul 7, 2026
Replace mInputs.back() with a named raw pointer (currentInput) captured before the move into mInputs, so the special-treatment binding for input_file / input_container_stdio / input_static_file is self-explanatory. Behavior is unchanged: both bind the input created in the current loop iteration, which need not be mInputs[0] now that the input whitelist is removed and multiple inputs may coexist. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Review feedback: task-tracking labels like "A3" carry no meaning in the source and confuse readers. Strip them from the input-coexistence comments in CollectionConfig and CollectionConfigUnittest, keeping the technical description of the removed input whitelist/blacklist gate. Comment-only change; no behavior change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Native file inputs (input_file / input_container_stdio / input_static_file_onetime) register their per-input state in FileServer keyed by config name only, so multiple such inputs in one pipeline would overwrite each other's registration and silently lose data. Restore the constraint that a native file input must be the sole input of its pipeline until FileServer keys registrations by (config, index). The A3 whitelist/blacklist removal is unaffected: a single native input still coexists freely with Go processors/flushers. Refs alibaba#2644 Fixes alibaba#2600 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Takuka0311
commented
Jul 7, 2026
A3 removes the input whitelist/blacklist gate but keeps two transitional restrictions the reviewer flagged as still unimplemented: the sole native file input rule (FileServer keys by config name only, tracked in alibaba#2644) and the single flusher_sls rule when Go flushers coexist. Restore their "remove this restriction" TODO markers so the pending cleanup stays visible in code, without epic/line labels. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Round review: the two "remove these special restrictions" TODOs above the hasFileInput detection blocks were dropped, but the file-input special casing they mark is still in place (unimplemented). Restore them per reviewer guidance to keep useful TODOs for restrictions not yet removed. Fixes alibaba#2600 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Epic #2595 · Discussion #1928 步骤 A3。依赖 A1 (#2596)、A2 (#2597) 均已合入。
A1 将 Input 类型白名单重构为「默认允许 + 黑名单(保持旧行为)」的过渡框架;A2 已按 Input 类型补齐 C++ 事件产出。本 PR 拆除该过渡闸门:任意注册在 PluginRegistry 的 Native Input,只要 Pipeline 含 Go Processor / Flusher,均可进入 Go——不再维护 Input 类型白名单。
改动
core/config/CollectionConfig.cppGetNativeInputBlacklistWhenUsingGoPlugin/IsNativeInputBlockedWhenUsingGoPlugin及hasFileInput分支(含#ifdef APSARA_UNIT_TEST_MAIN两支)input_file单 Input 过渡约束("more than 1 input_file …"),允许多个 Native 文件型 Input 共存flusher_sls可承接)→ 至多 1 个 native flusher 且须为flusher_sls;注释指向 B-line FlusherV2.Export([1928-b3] Extended Flusher 补齐 FlusherV2.Export #2623 / [1928-B4] Processor 迁移 + flusher_sls v2(按目录分批) #2603)解除#include <unordered_set>core/collection_pipeline/CollectionPipeline.cppmInputs.back()而非mInputs[0],修正多 Input / 文件 Input 非首位时的错误 castcore/unittest/config/CollectionConfigUnittest.cppNativeInputWithGoPlugin:由「黑名单拒绝」改为断言默认放行MultiInputAndFlusherCoexistence:多input_file+flusher_sls、Native+Go 多 Flusher 规则(成功与失败路径)HandleInvalidInputs移除已不再非法的「多个 input_file」用例不改默认 StructureType。 变更仅放宽校验:原先合法的配置行为不变,原先被拒的多 Input / Native+Go 组合现予放行。
验收标准
Test plan(本地实跑,非「待 CI」)
Docker 镜像
loongcollector-build-linux:2.1.17,-Werror编译通过(warning-clean)。Closes #2600
🤖 Generated with Claude Code