Skip to content

Commit

Permalink
5
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian committed Sep 26, 2024
1 parent fd0aa24 commit a011c26
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions be/src/cloud/cloud_meta_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,6 +757,15 @@ Status CloudMetaMgr::commit_rowset(const RowsetMeta& rs_meta,
<< ", rowset index disk size:" << rs_meta.index_disk_size()
<< ", rowset total disk size:" << rs_meta.total_disk_size() << ".";
}
if (rs_meta.index_disk_size() >
config::max_table_index_data_ratio * rs_meta.data_disk_size()) {
LOG(FATAL) << "[Cloud table size check failed]:"
<< " tablet id: " << rs_meta.tablet_id()
<< ", rowset id:" << rs_meta.rowset_id()
<< ", rowset data disk size:" << rs_meta.data_disk_size()
<< ", rowset index disk size:" << rs_meta.index_disk_size()
<< ", rowset total disk size:" << rs_meta.total_disk_size() << ".";
}
}
CreateRowsetRequest req;
CreateRowsetResponse resp;
Expand Down
1 change: 1 addition & 0 deletions be/src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1342,6 +1342,7 @@ DEFINE_Int32(query_cache_size, "512");

// Enable validation to check the correctness of table size.
DEFINE_Bool(enable_table_size_correctness_check, "false");
DEFINE_mDouble(max_table_index_data_ratio, "0.1");

// clang-format off
#ifdef BE_TEST
Expand Down
1 change: 1 addition & 0 deletions be/src/common/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,7 @@ DECLARE_Int32(query_cache_size);

// Enable validation to check the correctness of table size.
DECLARE_Bool(enable_table_size_correctness_check);
DECLARE_mDouble(max_table_index_data_ratio);

#ifdef BE_TEST
// test s3
Expand Down
9 changes: 9 additions & 0 deletions be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,15 @@ void Tablet::save_meta() {
<< ", rowset index disk size:" << rs_meta->index_disk_size()
<< ", rowset total disk size:" << rs_meta->total_disk_size() << ".";
}
if (rs_meta->index_disk_size() >
config::max_table_index_data_ratio * rs_meta->data_disk_size()) {
LOG(FATAL) << "[Local table index size check failed]:"
<< " tablet id: " << get_tablet_info().tablet_id
<< ", rowset id:" << rs_meta->rowset_id()
<< ", rowset data disk size:" << rs_meta->data_disk_size()
<< ", rowset index disk size:" << rs_meta->index_disk_size()
<< ", rowset total disk size:" << rs_meta->total_disk_size() << ".";
}
}
}
auto res = _tablet_meta->save_meta(_data_dir);
Expand Down

0 comments on commit a011c26

Please sign in to comment.