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 be/src/olap/compaction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,21 @@ bool CompactionMixin::handle_ordered_data_compaction() {
return false;
}

// Skip ordered data compaction if any rowset has inverted/ann index.
for (auto& rowset : _input_rowsets) {
const auto& meta = rowset->rowset_meta();
const auto& schema = meta->tablet_schema();
if (!schema) {
// RowsetMeta should always carry a valid schema in production, but unit tests and
// some auxiliary paths may build rowsets with an empty schema. Ordered data compaction
// must be conservative here to avoid undefined behavior.
return false;
}
if (schema->has_inverted_index() || schema->has_ann_index()) {
return false;
}
}

// If some rowsets has idx files and some rowsets has not, we can not do link file compaction.
// Since the output rowset will be broken.

Expand Down