Skip to content

Commit a120099

Browse files
morningmanclaude
andcommitted
[fix](test) read sql_block_rule_status from a single FE to deflake BLOCKS count
The BLOCKS column of information_schema.sql_block_rule_status is a SUM aggregated across all alive FEs (SchemaTable declares it with SchemaTableAggregateType.SUM and the table is fetch-all-FE), while each FE keeps its own non-replicated in-memory block counter. A single blocked SELECT is planned on exactly one FE and increments that FE's counter once, so on a multi-FE cluster a stray non-zero counter on another FE makes the cross-FE SUM exceed 1 and fails assertEquals("1", BLOCKS). Set fetch_all_fe_for_system_table=false before reading the status table so the scan reads only the local connection FE (the one that ran the blocked query), making BLOCKS deterministically 1. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent 1a51976 commit a120099

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎regression-test/suites/query_p0/schema_table/test_sql_block_rule_status.groovy‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,12 @@ suite("test_sql_block_rule_status") {
5353
"""
5454
exception "sql match"
5555
}
56+
// BLOCKS in sql_block_rule_status is a SUM aggregated across all alive FEs (the column is
57+
// declared with SchemaTableAggregateType.SUM and the table is fetch-all-FE), while each FE keeps
58+
// its own non-replicated in-memory block counter. The blocked query above is planned on exactly
59+
// one FE, so read the status from that single FE only to get a deterministic BLOCKS=1; otherwise
60+
// a stray non-zero counter on another FE makes the cross-FE SUM exceed 1 and flakes this test.
61+
sql "set fetch_all_fe_for_system_table=false"
5662
order_qt_count "SELECT count(*) FROM information_schema.sql_block_rule_status where name ='${blockRuleName}'"
5763
def statusRows = sql """
5864
SELECT NAME, PATTERN, SQL_HASH, PARTITION_NUM, TABLET_NUM, CARDINALITY, GLOBAL, ENABLE,

0 commit comments

Comments
 (0)