fix(tmq): add test case for drop table & updata docs#35141
fix(tmq): add test case for drop table & updata docs#35141guanshengliang merged 5 commits intomainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds CI coverage for a TMQ scenario involving dropping and recreating a child table, and updates TMQ documentation to reflect the correct RELOAD TOPIC support version and audit-field descriptions.
Changes:
- Add a new TMQ regression test flow (
check_drop_ctable) and run it fromtest_tmq_ts6379. - Register
test_tmq_ts6379.pyin CI tasks, and also re-enabletest_tmq_taosx.py. - Update EN/ZH TMQ docs to state
RELOAD TOPICis supported since 3.4.0; adjust EN/ZH security audit table row for “reload topic”.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| test/ci/cases.task | Adds TS-6379 test to CI and re-enables test_tmq_taosx.py. |
| test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py | Adds drop/recreate child-table TMQ test logic and invokes it in the test entrypoint. |
| docs/zh/14-reference/03-taos-sql/40-tmq.md | Updates RELOAD TOPIC supported-since version to 3.4.0. |
| docs/zh/08-operation/16-security.md | Corrects audit record fields for “reload topic”. |
| docs/zh/06-advanced/01-subscription/01-topic.md | Updates RELOAD TOPIC supported-since version to 3.4.0. |
| docs/en/14-reference/03-taos-sql/40-tmq.md | Updates RELOAD TOPIC supported-since version to 3.4.0. |
| docs/en/08-operation/16-security.md | Corrects audit record fields for “reload topic”. |
| docs/en/06-advanced/01-subscription/01-topic.md | Updates RELOAD TOPIC supported-since version to 3.4.0. |
Comments suppressed due to low confidence (3)
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:607
create database db_ctablewithoutIF EXISTS(and without any cleanup) can make this test non-idempotent and fail when rerun in the same environment. Considerdrop database if exists db_ctableat the start (orcreate database if not exists ...) and optionally drop it infinallyto avoid cross-test interference.
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:633- The "no data after drop table" assertion stops after the first empty poll. That can miss late-arriving records (or delayed delivery) and lead to a false pass. Consider polling for a fixed total duration (e.g., 5–10 seconds) and only passing if all polls return empty/no-value during that whole window.
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:646 - When expecting data after recreating the table +
reload topic, this loop fails immediately on the first emptypoll(1), which is prone to timing flakiness in CI. Consider looping until a reasonable timeout (or a max retry count) before failing, and validate the received record’s topic/table to ensure the message is from the recreated table.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Code Review
This pull request updates the documentation to reflect that the RELOAD TOPIC syntax is supported starting from version 3.4.0 and corrects the associated audit log information. It also introduces a new test case, check_drop_ctable, to verify topic reloading after a table is dropped and recreated, and enables several tests in the CI configuration. Feedback suggests using IF NOT EXISTS when creating databases in tests to avoid conflicts and simplifying a redundant loop in the new test logic to improve readability.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 6 comments.
Comments suppressed due to low confidence (3)
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:613
- This test creates
db_stablewithout any prior cleanup (noDROP DATABASE IF EXISTS/CREATE DATABASE IF NOT EXISTS) and uses fixed names (db_stable,st,t1,t2). That makes it prone to failures on reruns or shared/parallel CI because these objects may already exist. Prefer namespacing withfunc_name(or add drop-if-exists) and clean up created topics/databases in afinallyblock.
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:666 check_drop_stable_stable_topic()dropst2/db_stableat the start but then creates topict3and never drops it (nordb_stable) at the end. This can leave state behind that interferes with reruns/other tests. Please add cleanup fort3(and optionallydb_stable) in afinallyblock or use unique names per test.
test/cases/17-DataSubscription/02-Consume/test_tmq_ts6379.py:716check_drop_ctable()createsdb_ctablewithoutIF NOT EXISTS/ priorDROP DATABASE IF EXISTS, and it also creates a fixed-name topic/table (t1). This makes the test sensitive to reruns and shared environments. Prefer a per-test unique database/topic/table name (e.g., based onfunc_name) or add explicit cleanup at start/end.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Code Review — PR #35141本 PR 移除了 [HIGH] 行为兼容性破坏:移除 DROP 超级表的 topic 保护检查文件:
这是一个语义兼容性破坏:使用了该错误码进行防御性检查的上层代码将失去保护。建议在 PR 描述中明确说明此为 intentional breaking change,并确认是否需要更新错误码或升级文档中的"从 X 版本起支持"说明。 新增的三个测试用例仅覆盖了 DROP 后 poll 的静止状态,未测试 DROP 发生时正在活跃消费的 consumer 的行为(例如:consumer 正在 poll 时超级表被删)。建议补充该场景的测试。 [MEDIUM] 文档:删除了"新增列不出现在结果中"的说明文件: 原文档有一条说明:"若发生表结构变更,新增的列不出现在结果中(If there are changes to the table structure, new columns will not appear in the results)"。此条被直接删除,但没有 RELOAD TOPIC 的情况下该限制仍然成立。建议改写为:
避免用户误解为新增列会自动出现在订阅结果中。 [MEDIUM] cases.task:
|
Description
Issue(s)
Checklist
Please check the items in the checklist if applicable.