File tree 1 file changed +13
-2
lines changed
crates/common/src/bootstrap_model/index/search_index
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -48,8 +48,19 @@ impl TryFrom<SearchIndexState> for SerializedSearchIndexState {
48
48
49
49
fn try_from ( state : SearchIndexState ) -> Result < Self , Self :: Error > {
50
50
Ok ( match state {
51
- SearchIndexState :: Backfilling ( state) => SerializedSearchIndexState :: Backfilling2 {
52
- backfill_state : state. try_into ( ) ?,
51
+ SearchIndexState :: Backfilling ( state) => {
52
+ // Maintain rollback compatibility with the old format by writing empty
53
+ // backfilling states using the old format. Since we don't
54
+ // currently use the new format, all states should be empty, so
55
+ // we should always write the old format. TODO(CX-6465): Clean
56
+ // this up.
57
+ if state. segments . is_empty ( ) && state. cursor . is_none ( ) {
58
+ SerializedSearchIndexState :: Backfilling
59
+ } else {
60
+ SerializedSearchIndexState :: Backfilling2 {
61
+ backfill_state : state. try_into ( ) ?,
62
+ }
63
+ }
53
64
} ,
54
65
SearchIndexState :: Backfilled ( snapshot) => SerializedSearchIndexState :: Backfilled {
55
66
snapshot : snapshot. try_into ( ) ?,
You can’t perform that action at this time.
0 commit comments