Skip to content

Commit

Permalink
[fix](move-memtable) make sure index descriptor is set when creating …
Browse files Browse the repository at this point in the history
…delta writer (apache#30157)


---------

Co-authored-by: Yongqiang YANG <98214048+dataroaring@users.noreply.github.com>
Co-authored-by: Xin Liao <liaoxinbit@126.com>
  • Loading branch information
3 people authored Jan 22, 2024
1 parent 6a4c0d8 commit c4291bc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions be/src/vec/sink/writer/vtablet_writer_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -431,15 +431,27 @@ Status VTabletWriterV2::_write_memtable(std::shared_ptr<vectorized::Block> block
.is_high_priority = _is_high_priority,
.write_file_cache = _write_file_cache,
};
bool index_not_found = true;
for (const auto& index : _schema->indexes()) {
if (index->index_id == rows.index_id) {
req.slots = &index->slots;
req.schema_hash = index->schema_hash;
index_not_found = false;
break;
}
}
if (index_not_found) {
LOG(WARNING) << "index " << rows.index_id
<< " not found in schema, load_id=" << print_id(_load_id);
return std::unique_ptr<DeltaWriterV2>(nullptr);
}
return DeltaWriterV2::open(&req, streams, _state);
});
if (delta_writer == nullptr) {
LOG(WARNING) << "failed to open DeltaWriter for tablet " << tablet_id
<< ", load_id=" << print_id(_load_id);
return Status::InternalError("failed to open DeltaWriter for tablet {}", tablet_id);
}
{
SCOPED_TIMER(_wait_mem_limit_timer);
ExecEnv::GetInstance()->memtable_memory_limiter()->handle_memtable_flush();
Expand Down

0 comments on commit c4291bc

Please sign in to comment.