@@ -55,7 +55,7 @@ def _get_service_url(cls):
55
55
@classmethod
56
56
def get_cluster_nodes (cls , path = None ):
57
57
try :
58
- url = f'{ cls ._get_service_url ()} /viewer/json/nodes?database={ cls .ydb_database } '
58
+ url = f'{ cls ._get_service_url ()} /viewer/json/nodes?database=/ { cls .ydb_database } '
59
59
if path is not None :
60
60
url += f'&path={ path } &tablets=true'
61
61
headers = {}
@@ -129,17 +129,16 @@ def get_ydb_driver(cls):
129
129
return cls ._ydb_driver
130
130
131
131
@classmethod
132
- def _list_directory_impl (cls , root_path : str , rel_path : str ) -> List [ydb .SchemeEntry ]:
133
- full_path = f'{ root_path } /{ rel_path } '
134
- LOGGER .info (f'list { full_path } ' )
132
+ def _list_directory_impl (cls , path ) -> List [ydb .SchemeEntry ]:
133
+ LOGGER .info (f'list { path } ' )
135
134
result = []
136
- for child in cls .get_ydb_driver ().scheme_client .list_directory (full_path ).children :
135
+ for child in cls .get_ydb_driver ().scheme_client .list_directory (path ).children :
137
136
if child .name == '.sys' :
138
137
continue
139
- child .name = f'{ rel_path } /{ child .name } '
140
- if child .is_directory () or child .is_column_store ():
141
- result += cls ._list_directory_impl (root_path , child .name )
138
+ child .name = f'{ path } /{ child .name } '
142
139
result .append (child )
140
+ if child .is_directory () or child .is_column_store ():
141
+ result += cls ._list_directory_impl (child .name )
143
142
return result
144
143
145
144
@classmethod
@@ -155,7 +154,7 @@ def _get_tables(cls, path):
155
154
self_descr = cls ._describe_path_impl (full_path )
156
155
if self_descr is not None :
157
156
if self_descr .is_directory ():
158
- for descr in cls ._list_directory_impl (full_path , '/' ):
157
+ for descr in cls ._list_directory_impl (full_path ):
159
158
if descr .is_any_table ():
160
159
result .append (descr .name )
161
160
elif self_descr .is_any_table ():
@@ -246,10 +245,11 @@ def _check_node(n):
246
245
errors .append (f'Node { tn .get ("SystemState" , {}).get ("Host" )} : { tablet .get ("Count" )} tablets of type { tablet .get ("Type" )} in { tablet .get ("State" )} state' )
247
246
if tablet .get ("Type" ) in {"ColumnShard" , "DataShard" }:
248
247
tablet_count += tablet .get ("Count" )
249
- if min is None or tablet_count < min :
250
- min = tablet_count
251
- if max is None or tablet_count > max :
252
- max = tablet_count
248
+ if tablet_count > 0 :
249
+ if min is None or tablet_count < min :
250
+ min = tablet_count
251
+ if max is None or tablet_count > max :
252
+ max = tablet_count
253
253
if min is None or max is None :
254
254
errors .append (f'Table { p } has no tablets' )
255
255
elif max - min > 1 :
0 commit comments