Skip to content
Open
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
15 changes: 15 additions & 0 deletions src/db/index/segment/segment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3939,6 +3939,14 @@ VectorColumnIndexer::Ptr SegmentImpl::create_vector_indexer(
memory_vector_block_ids_[field_name] = block_id;
}

if (FileHelper::FileExists(index_file_path)) {
LOG_WARN(
"Index file[%s] already exists (possible crash residue); cleaning and "
"overwriting.",
index_file_path.c_str());
FileHelper::RemoveFile(index_file_path);
}

auto vector_indexer =
std::make_shared<VectorColumnIndexer>(index_file_path, field);
vector_column_params::ReadOptions options{true, true};
Expand All @@ -3958,6 +3966,13 @@ Status SegmentImpl::init_memory_components() {
// create and open memory forward block
auto mem_path = FileHelper::MakeForwardBlockPath(seg_path_, mem_block.id_,
!options_.enable_mmap_);
if (FileHelper::FileExists(mem_path)) {
LOG_WARN(
"ForwardBlock file[%s] already exists (possible crash residue); "
"cleaning and overwriting.",
mem_path.c_str());
FileHelper::RemoveFile(mem_path);
}
memory_store_ = std::make_shared<MemForwardStore>(
collection_schema_, mem_path,
options_.enable_mmap_ ? FileFormat::IPC : FileFormat::PARQUET,
Expand Down