File tree Expand file tree Collapse file tree
vectordb_bench/backend/clients/milvus Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,23 +165,27 @@ def _optimize(self):
165165 log .info (f"{ self .name } optimizing before search" )
166166 try :
167167 self .client .flush (self .collection_name )
168- self ._wait_for_segments_sorted ()
169- self ._wait_for_index ()
168+
170169 if self .case_config .is_gpu_index :
171170 log .debug ("skip force merge compaction for gpu index type." )
172171 else :
173172 try :
173+ # wait for sort, index, comapct
174+ self ._wait_for_segments_sorted ()
175+ self ._wait_for_index ()
174176 compaction_id = self .client .compact (self .collection_name , target_size = (2 ** 63 - 1 ))
175177 if compaction_id > 0 :
176178 self ._wait_for_compaction (compaction_id )
177179 log .info (f"{ self .name } force merge compaction completed." )
178- self ._wait_for_index ()
179180 except Exception as e :
180- log .warning (f"{ self .name } compact error: { e } " )
181+ log .warning (f"{ self .name } compact or list segments error: { e } " )
181182 if hasattr (e , "code" ) and e .code ().name == "PERMISSION_DENIED" :
182- log .warning ("Skip compact due to permission denied." )
183+ log .warning ("Skip compact due to list segments or compact permission denied." )
183184 else :
184185 raise e from None
186+
187+ # wait for index no matter what
188+ self ._wait_for_index ()
185189 self .client .refresh_load (self .collection_name )
186190 except Exception as e :
187191 log .warning (f"{ self .name } optimize error: { e } " )
You can’t perform that action at this time.
0 commit comments