fix(tmq): remove epset that is useless#35126
Conversation
…odeSubscribeObj Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Pull request overview
This PR primarily updates TMQ subscription/consumer state handling by removing persisted endpoint sets (epset) where they’re no longer needed, and adjusts related audit behavior/tests and documentation.
Changes:
- TMQ: remove persisted
SEpSet/SMqVgEpfrom subscription/consumer SDB state, bumping related SDB soft versions and updating rebalance logic to trackvgIdonly. - Audit: adjust audit user/token handling and ensure audit STB is created for audit DBs regardless of
auditSaveInSelf, adding CI test coverage for “no token” and “self audit switch off”. - Misc: update client callback to fully clear “table not exist as empty” error state; update TDgpt anomaly-detection docs for multi-column input.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
source/dnode/mnode/impl/src/mndSubscribe.c |
Switch unassigned/assigned vgroup tracking to int32_t vgId only; bump subscribe SDB version; remove epset update logic. |
source/dnode/mnode/impl/src/mndConsumer.c |
Switch consumer ep tracking to vgId only and build response epsets dynamically; bump consumer SDB version. |
source/dnode/mnode/impl/src/mndDef.c |
Update encode/decode for subscribe/consumer objects to drop epset fields while keeping backward decode compatibility. |
source/dnode/mnode/impl/inc/mndDef.h |
Remove SMqVgEp and consumer ep field; update structures to store only vgId. |
source/dnode/mnode/impl/src/mndDb.c |
Always create audit STB when creating an audit DB (no longer gated by tsAuditSaveInSelf). |
source/dnode/mnode/impl/src/mndDnode.c |
Fetch active token for the configured audit user (not hardcoded "audit"). |
source/libs/new-stream/src/streamTriggerTask.c |
Adjust trigger history logic (count/session/meta-related behavior). |
source/client/src/clientImpl.c |
Clear request-level error code/message when treating “table not exist” as empty result. |
test/ci/cases.task |
Add the two new component test cases to CI task list. |
test/cases/80-Components/01-Taosd/test_com_taosd_audit.py |
Update audit test to use cus_audit user and token creation steps. |
test/cases/80-Components/01-Taosd/test_com_taosd_audit_no_token.py |
New test for audit telemetry with auditUseToken=0. |
test/cases/80-Components/01-Taosd/test_com_taosd_self_audit_switch_off.py |
New test for switching auditSaveInSelf behavior. |
docs/zh/.../03-ad.md, docs/en/.../03-ad.md, docs/en/.../index.md |
Document multi-column anomaly detection input behavior and new self.input_data_lists. |
Comments suppressed due to low confidence (2)
source/libs/new-stream/src/streamTriggerTask.c:11755
readAllDatais now hardcoded totrueand never modified, so the metadata-accelerated branch (if (!readAllData)) becomes dead code and count-window history checks will always scan full data blocks. Either restore the previous conditional so the optimized path can be used when safe, or delete the unreachable branch to avoid misleading future changes (and consider the performance impact of always scanning).
SStreamTriggerTask *pTask = pContext->pTask;
bool readAllData = true;
bool allTableProcessed = false;
bool needFetchData = false;
#define ALIGN_UP(x, b) (((x) + (b) - 1) / (b) * (b))
while (!allTableProcessed && !needFetchData) {
if (!readAllData) {
// use table metadatas to accelerate the count window check
if (IS_TRIGGER_TIMESTAMP_SORTER_EMPTY(pContext->pSorter)) {
stTimestampSorterReset(pContext->pSorter);
pContext->pCurTableMeta = tSimpleHashIterate(pGroup->pTableMetas, pContext->pCurTableMeta, &pContext->tbIter);
if (pContext->pCurTableMeta == NULL) {
// actually, it has only one table
source/libs/new-stream/src/streamTriggerTask.c:2600
- This change drops
STREAM_TRIGGER_COUNTfrom thehistTrigTsIndexinitialization special-case. If count-window history blocks still place the trigger timestamp in slot 0 (as before), switching totrigTsIndexcan make history logic read the wrong column as the timestamp. Please confirm the slot layout for count-trigger history blocks and keepSTREAM_TRIGGER_COUNTin the special-case if its history scan always uses ts at index 0.
if (pTask->triggerType == STREAM_TRIGGER_SESSION || pTask->triggerType == STREAM_TRIGGER_SLIDING) {
pTask->histTrigTsIndex = 0;
} else {
pTask->histTrigTsIndex = pTask->trigTsIndex;
}
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Verify that after changing taosd's epset (fqdn + port) and force killing, WAL replay of old rebalance transactions fails until ep.json provides the epset mapping to resolve pending transactions. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review 结果本次审查覆盖范围:Change Summarizer、Broad Scanner、Performance Reviewer、Maintainability Reviewer、Rule Reviewer 全部完成。 变更概要本 PR 将 TMQ 订阅/消费者数据模型中的 发现 3 个已验证问题: 问题 1 — [Medium/高置信] Correctness:vgroup 获取失败时 consumer 会丢失对应 vg 的订阅位置: 问题:旧代码在 修复方向:若 acquire 失败,可在 问题 2 — [Low-Medium/中置信] Performance:每次 consumer 订阅应答都触发全量 vgroup acquire位置: 问题:旧代码仅在 修复方向:考虑恢复类似 问题 3 — [Low/高置信] Testing:新增测试在 CI 中被注释 + taos.cfg 修改后无清理位置 A: 问题 A:覆盖本 PR 核心修复场景(epset 变更后 WAL 重放卡住)的测试被注释掉,不会在 CI 中自动执行,本 PR 的回归保护实际缺失。 位置 B: 问题 B:测试直接读写 修复方向:
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.