Caideyipi commented on code in PR #19114:
URL: https://github.com/apache/iotdb/pull/19114#discussion_r4463461753
##########
integration-test/src/test/java/org/apache/iotdb/db/it/utils/TestUtils.java:
##########
@@ -1747,6 +1749,39 @@ public static void restartCluster(BaseEnv env) {
env.startAllConfigNodes();
env.startAllDataNodes();
((AbstractEnv) env).checkClusterStatusWithoutUnknown();
+ awaitAllRegionsRunning(env);
+ }
+
+ /**
+ * Waits until every Region listed by SHOW REGIONS is Running. A running
node does not imply a
+ * serving Region: right after a restart the RegionGroups of a Database stay
Disabled in the
+ * ConfigNode LoadCache until all their Regions report Running, and any
write issued in that
+ * window, including an active LOAD, is rejected with
NO_AVAILABLE_REGION_GROUP.
+ */
+ public static void awaitAllRegionsRunning(final BaseEnv env) {
+ await()
+ .pollInSameThread()
+ .pollDelay(0L, TimeUnit.SECONDS)
+ .pollInterval(1L, TimeUnit.SECONDS)
+ .atMost(2, TimeUnit.MINUTES)
+ .ignoreExceptions()
+ .untilAsserted(
+ () -> {
+ try (final Connection connection = env.getConnection();
Review Comment:
**[P2] Include table-model Regions in the readiness check**
`BaseEnv.getConnection()` always opens a tree-dialect connection. In that
dialect, `TreeConfigTaskVisitor.visitShowRegion()` passes `isTableModel=false`,
and `PartitionInfo.getRegionInfoList()` filters out table-model databases. A
table-only cluster therefore produces an empty result here and immediately
passes the wait even while its RegionGroups are still Disabled; a mixed cluster
only waits for its tree Regions. Existing table-model callers such as
`IoTDBPipeLifeCycleIT.testLifeCycleWithClusterRestart()` consequently retain
the restart/write race that this helper is intended to prevent. Please check
both tree and table `SHOW REGIONS` results, or use a query that includes both
models, and cover the table-only case.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]