Skip to content

Commit 428abc1

Browse files
authored
fix: reading large fragment reuse index details fails with file not found (#4035)
1 parent ac10a1b commit 428abc1

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

rust/lance/src/dataset/optimize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2803,7 +2803,7 @@ mod tests {
28032803
lance_datagen::array::rand_vec::<Float32Type>(Dimension::from(128)),
28042804
)
28052805
.col("id", lance_datagen::array::step::<Int32Type>())
2806-
.into_ram_dataset(FragmentCount::from(6), FragmentRowCount::from(1000))
2806+
.into_ram_dataset(FragmentCount::from(110), FragmentRowCount::from(1000))
28072807
.await
28082808
.unwrap();
28092809

rust/lance/src/index/frag_reuse.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pub async fn load_frag_reuse_index_details(
5050
}
5151
Some(Content::External(external_file)) => {
5252
let file_path = dataset
53-
.base
53+
.indices_dir()
5454
.child(index.uuid.to_string())
5555
.child(external_file.path.clone());
5656

@@ -150,8 +150,9 @@ pub(crate) async fn build_frag_reuse_index_metadata(
150150
writer
151151
.write_all(new_index_details_proto.encode_to_vec().as_slice())
152152
.await?;
153+
writer.shutdown().await?;
153154
let external_file = ExternalFile {
154-
path: file_path.to_string(),
155+
path: FRAG_REUSE_DETAILS_FILE_NAME.to_owned(),
155156
offset: 0,
156157
size: new_index_details_proto.encoded_len() as u64,
157158
};

0 commit comments

Comments
 (0)