@@ -43,6 +43,7 @@ use crate::{
4343 search_compactor:: CompactionConfig ,
4444 timeout_with_jitter,
4545 writer:: SearchIndexMetadataWriter ,
46+ FlusherType ,
4647 } ,
4748 text_index_worker:: {
4849 compactor:: {
@@ -122,8 +123,8 @@ impl SearchIndexWorkers {
122123 segment_term_metadata_fetcher : segment_term_metadata_fetcher. clone ( ) ,
123124 } ,
124125 ) ;
125- let vector_flush = retry_loop_expect_occs_and_overloaded (
126- "VectorFlusher " ,
126+ let vector_live_flush = retry_loop_expect_occs_and_overloaded (
127+ "VectorLiveFlusher " ,
127128 runtime. clone ( ) ,
128129 database. clone ( ) ,
129130 // Wait a bit since vector needs time to bootstrap. Makes startup logs a bit cleaner.
@@ -136,6 +137,24 @@ impl SearchIndexWorkers {
136137 reader. clone ( ) ,
137138 search_storage. clone ( ) ,
138139 vector_index_metadata_writer. clone ( ) ,
140+ FlusherType :: LiveFlush ,
141+ ) ) ,
142+ ) ;
143+ let vector_backfill_flush = retry_loop_expect_occs_and_overloaded (
144+ "VectorBackfillFlusher" ,
145+ runtime. clone ( ) ,
146+ database. clone ( ) ,
147+ // Wait a bit since vector needs time to bootstrap. Makes startup logs a bit cleaner.
148+ Duration :: from_secs ( 5 ) ,
149+ * INDEX_WORKERS_INITIAL_BACKOFF ,
150+ * SEARCH_INDEX_FLUSHER_MAX_BACKOFF ,
151+ SearchIndexWorker :: VectorFlusher ( new_vector_flusher (
152+ runtime. clone ( ) ,
153+ database. clone ( ) ,
154+ reader. clone ( ) ,
155+ search_storage. clone ( ) ,
156+ vector_index_metadata_writer. clone ( ) ,
157+ FlusherType :: Backfill ,
139158 ) ) ,
140159 ) ;
141160 let vector_compact = retry_loop_expect_occs_and_overloaded (
@@ -153,22 +172,41 @@ impl SearchIndexWorkers {
153172 vector_index_metadata_writer,
154173 ) ) ,
155174 ) ;
156- let text_flusher = SearchIndexWorker :: TextFlusher ( new_text_flusher (
175+ let text_live_flusher = SearchIndexWorker :: TextFlusher ( new_text_flusher (
176+ runtime. clone ( ) ,
177+ database. clone ( ) ,
178+ reader. clone ( ) ,
179+ search_storage. clone ( ) ,
180+ segment_term_metadata_fetcher. clone ( ) ,
181+ text_index_metadata_writer. clone ( ) ,
182+ FlusherType :: LiveFlush ,
183+ ) ) ;
184+ let text_live_flush = retry_loop_expect_occs_and_overloaded (
185+ "TextLiveFlusher" ,
186+ runtime. clone ( ) ,
187+ database. clone ( ) ,
188+ Duration :: ZERO ,
189+ * INDEX_WORKERS_INITIAL_BACKOFF ,
190+ * SEARCH_INDEX_FLUSHER_MAX_BACKOFF ,
191+ text_live_flusher,
192+ ) ;
193+ let text_backfill_flusher = SearchIndexWorker :: TextFlusher ( new_text_flusher (
157194 runtime. clone ( ) ,
158195 database. clone ( ) ,
159196 reader,
160197 search_storage. clone ( ) ,
161198 segment_term_metadata_fetcher,
162199 text_index_metadata_writer. clone ( ) ,
200+ FlusherType :: Backfill ,
163201 ) ) ;
164- let text_flush = retry_loop_expect_occs_and_overloaded (
165- "SearchFlusher " ,
202+ let text_backfill_flush = retry_loop_expect_occs_and_overloaded (
203+ "TextBackfillFlusher " ,
166204 runtime. clone ( ) ,
167205 database. clone ( ) ,
168206 Duration :: ZERO ,
169207 * INDEX_WORKERS_INITIAL_BACKOFF ,
170208 * SEARCH_INDEX_FLUSHER_MAX_BACKOFF ,
171- text_flusher ,
209+ text_backfill_flusher ,
172210 ) ;
173211
174212 let text_compact = retry_loop_expect_occs_and_overloaded (
@@ -187,15 +225,20 @@ impl SearchIndexWorkers {
187225 ) ) ,
188226 ) ;
189227
190- let vector_flush_handle = runtime. spawn ( "vector_flush" , vector_flush) ;
228+ let vector_backfill_flush_handle =
229+ runtime. spawn ( "vector_backfill_flush" , vector_backfill_flush) ;
230+ let vector_live_flush_handle = runtime. spawn ( "vector_live_flush" , vector_live_flush) ;
191231 let vector_compact_handle = runtime. spawn ( "vector_compact" , vector_compact) ;
192- let text_flush_handle = runtime. spawn ( "text_flush" , text_flush) ;
232+ let text_live_flush_handle = runtime. spawn ( "text_live_flush" , text_live_flush) ;
233+ let text_backfill_flush_handle = runtime. spawn ( "text_backfill_flush" , text_backfill_flush) ;
193234 let text_compact_handle = runtime. spawn ( "text_compact" , text_compact) ;
194235 Self {
195236 handles : vec ! [
196- vector_flush_handle,
237+ vector_backfill_flush_handle,
238+ vector_live_flush_handle,
197239 vector_compact_handle,
198- text_flush_handle,
240+ text_live_flush_handle,
241+ text_backfill_flush_handle,
199242 text_compact_handle,
200243 ] ,
201244 }
0 commit comments