You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ydb/tests/olap/lib/ydb_cluster.py
+22-21Lines changed: 22 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -235,27 +235,28 @@ def _check_node(n):
235
235
elifisinstance(balanced_paths, list):
236
236
forpathinbalanced_paths:
237
237
paths_to_balance+=cls._get_tables(path)
238
-
forpinpaths_to_balance:
239
-
table_nodes, _=cls.get_cluster_nodes(p)
240
-
min=None
241
-
max=None
242
-
fortnintable_nodes:
243
-
tablet_count=0
244
-
fortabletintn.get("Tablets", []):
245
-
iftablet.get("State") !="Green":
246
-
errors.append(f'Node {tn.get("SystemState", {}).get("Host")}: {tablet.get("Count")} tablets of type {tablet.get("Type")} in {tablet.get("State")} state')
247
-
iftablet.get("Type") in {"ColumnShard", "DataShard"}:
248
-
tablet_count+=tablet.get("Count")
249
-
iftablet_count>0:
250
-
ifminisNoneortablet_count<min:
251
-
min=tablet_count
252
-
ifmaxisNoneortablet_count>max:
253
-
max=tablet_count
254
-
ifminisNoneormaxisNone:
255
-
errors.append(f'Table {p} has no tablets')
256
-
elifmax-min>1:
257
-
errors.append(f'Table {p} is not balanced: {min}-{max} shards.')
258
-
LOGGER.info(f'Table {p} is balanced: {min}-{max} shards.')
errors.append(f'Node {tn.get("SystemState", {}).get("Host")}: {tablet.get("Count")} tablets of type {tablet.get("Type")} in {tablet.get("State")} state')
248
+
iftablet.get("Type") in {"ColumnShard", "DataShard"}:
249
+
tablet_count+=tablet.get("Count")
250
+
iftablet_count>0:
251
+
ifminisNoneortablet_count<min:
252
+
min=tablet_count
253
+
ifmaxisNoneortablet_count>max:
254
+
max=tablet_count
255
+
ifminisNoneormaxisNone:
256
+
errors.append(f'Table {p} has no tablets')
257
+
elifmax-min>1:
258
+
errors.append(f'Table {p} is not balanced: {min}-{max} shards.')
259
+
LOGGER.info(f'Table {p} is balanced: {min}-{max} shards.')
0 commit comments