Skip to content

Commit 72a11f3

Browse files
authored
Log corresponding database when the RegionGroups are not available (apache#16244)
1 parent cc66a38 commit 72a11f3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/exception/NoAvailableRegionGroupException.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,22 @@
2121

2222
import org.apache.iotdb.common.rpc.thrift.TConsensusGroupType;
2323

24+
import java.util.List;
25+
2426
public class NoAvailableRegionGroupException extends ConfigNodeException {
2527

26-
private static final String SCHEMA_REGION_GROUP = "SchemaRegionGroup";
27-
private static final String DATA_REGION_GROUP = "DataRegionGroup";
28+
private static final String SCHEMA_REGION_GROUP = "SchemaRegionGroups";
29+
private static final String DATA_REGION_GROUP = "DataRegionGroups";
2830

29-
public NoAvailableRegionGroupException(final TConsensusGroupType regionGroupType) {
31+
public NoAvailableRegionGroupException(
32+
final TConsensusGroupType regionGroupType, final List<String> databases) {
3033
super(
3134
String.format(
32-
"There are no available %s RegionGroups currently, "
35+
"There are no available %s for databases: %s currently, "
3336
+ "please use \"show cluster\" or \"show regions\" to check the cluster status",
3437
TConsensusGroupType.SchemaRegion.equals(regionGroupType)
3538
? SCHEMA_REGION_GROUP
36-
: DATA_REGION_GROUP));
39+
: DATA_REGION_GROUP,
40+
databases));
3741
}
3842
}

iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/partition/PartitionManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ public List<Pair<Long, TConsensusGroupId>> getSortedRegionGroupSlotsCounter(
961961
}
962962

963963
if (result.isEmpty()) {
964-
throw new NoAvailableRegionGroupException(type);
964+
throw new NoAvailableRegionGroupException(type, Collections.singletonList(database));
965965
}
966966

967967
final Map<TConsensusGroupId, RegionGroupStatus> regionGroupStatusMap =

0 commit comments

Comments
 (0)