@@ -107,23 +107,30 @@ def upload_vectors(self, vectors: np.ndarray):
107107 )
108108
109109 def wait_for_green (self , timeout : int = 1800 ):
110- print ("Waiting for green status..." , end = "" , flush = True )
110+ print ("Waiting for green status..." )
111111 wait_time = 5.0
112112 total = 0
113+ info = None
113114 while total < timeout :
114115 time .sleep (wait_time )
115116 total += wait_time
116117 info = self .primary .get_collection (COLLECTION_NAME )
117- if info .status != models .CollectionStatus .GREEN :
118- print ("." , end = "" , flush = True )
118+ status = info .status
119+ indexed = info .indexed_vectors_count
120+ total_vectors = info .vectors_count
121+ segments = info .segments_count
122+ print (f" [{ total :.0f} s] status={ status } , indexed={ indexed } /{ total_vectors } , segments={ segments } " )
123+
124+ if status != models .CollectionStatus .GREEN :
119125 continue
120126 # Double-check: status can briefly flip to GREEN during optimization
121127 time .sleep (wait_time )
122128 info = self .primary .get_collection (COLLECTION_NAME )
123129 if info .status == models .CollectionStatus .GREEN :
124- print (f" done ( { total :.1f} s) " )
130+ print (f"Collection is GREEN after { total :.1f} s" )
125131 return
126- print (f" timeout after { timeout } s" )
132+ final_status = info .status if info else 'unknown'
133+ print (f"WARNING: timeout after { timeout } s, status={ final_status } " )
127134
128135 def get_collection_cluster_info (self ) -> dict :
129136 return self .primary .http .distributed_api .collection_cluster_info (COLLECTION_NAME ).dict ()["result" ]
0 commit comments