Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -476,8 +476,8 @@ impl FileBackedIndex {

self.metadata.add_source(source_config)?;

self.per_source_shards
.insert(source_id.clone(), Shards::empty(index_uid, source_id));
let shards = Shards::empty(index_uid, source_id.clone());
self.per_source_shards.insert(source_id, shards);
Ok(())
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ impl From<FileBackedIndex> for FileBackedIndexV0_6 {
let shards = index
.per_source_shards
.into_iter()
.map(|(source_id, shards)| (source_id, SerdeShards::from(shards)))
.filter_map(|(source_id, shards)| {
// Skip serializing empty shards since the feature is hidden and disabled by
// default. This way, we can still modify the serialization format without worrying
// about backward compatibility post `0.7`.
if shards.next_shard_id > 1 {
Some((source_id, SerdeShards::from(shards)))
} else {
None
}
})
.collect();
let delete_tasks = index
.delete_tasks
Expand Down