Skip to content

Commit

Permalink
[cherry-pick](branch-3.0) Pick "[Fix](status) Fix wrong status check …
Browse files Browse the repository at this point in the history
…in data size check (#43545)" (#44085)

### What problem does this PR solve?

Issue Number: close #xxx

Pick #43545
  • Loading branch information
Yukang-Lian authored Nov 17, 2024
1 parent d252fca commit a4406ff
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
6 changes: 3 additions & 3 deletions be/src/cloud/cloud_meta_mgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,7 @@ int64_t CloudMetaMgr::get_segment_file_size(const RowsetMeta& rs_meta) {
auto st = fs->file_size(segment_path, &segment_file_size);
if (!st.ok()) {
segment_file_size = 0;
if (st.is<FILE_NOT_EXIST>()) {
if (st.is<NOT_FOUND>()) {
LOG(INFO) << "cloud table size correctness check get segment size 0 because "
"file not exist! msg:"
<< st.msg() << ", segment path:" << segment_path;
Expand Down Expand Up @@ -1239,7 +1239,7 @@ int64_t CloudMetaMgr::get_inverted_index_file_szie(const RowsetMeta& rs_meta) {
auto st = fs->file_size(inverted_index_file_path, &file_size);
if (!st.ok()) {
file_size = 0;
if (st.is<FILE_NOT_EXIST>()) {
if (st.is<NOT_FOUND>()) {
LOG(INFO) << "cloud table size correctness check get inverted index v1 "
"0 because file not exist! msg:"
<< st.msg()
Expand All @@ -1265,7 +1265,7 @@ int64_t CloudMetaMgr::get_inverted_index_file_szie(const RowsetMeta& rs_meta) {
auto st = fs->file_size(inverted_index_file_path, &file_size);
if (!st.ok()) {
file_size = 0;
if (st.is<FILE_NOT_EXIST>()) {
if (st.is<NOT_FOUND>()) {
LOG(INFO) << "cloud table size correctness check get inverted index v2 "
"0 because file not exist! msg:"
<< st.msg() << ", inverted index path:" << inverted_index_file_path;
Expand Down
1 change: 0 additions & 1 deletion be/src/common/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ namespace ErrorCode {
E(NEED_SEND_AGAIN, -241, false); \
E(OS_ERROR, -242, true); \
E(DIR_NOT_EXIST, -243, true); \
E(FILE_NOT_EXIST, -244, true); \
E(CREATE_FILE_ERROR, -245, true); \
E(STL_ERROR, -246, true); \
E(MUTEX_ERROR, -247, true); \
Expand Down
2 changes: 1 addition & 1 deletion be/src/olap/schema_change.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1431,7 +1431,7 @@ Status SchemaChangeJob::_validate_alter_result(const TAlterTabletReqV2& request)
for (auto& pair : version_rowsets) {
RowsetSharedPtr rowset = pair.second;
if (!rowset->check_file_exist()) {
return Status::Error<FILE_NOT_EXIST>(
return Status::Error<NOT_FOUND>(
"SchemaChangeJob::_validate_alter_result meet invalid rowset");
}
}
Expand Down
20 changes: 14 additions & 6 deletions be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2794,12 +2794,20 @@ int64_t Tablet::get_inverted_index_file_szie(const RowsetMetaSharedPtr& rs_meta)
auto st = fs->file_size(inverted_index_file_path, &file_size);
if (!st.ok()) {
file_size = 0;
LOG(WARNING) << " tablet id: " << get_tablet_info().tablet_id
<< ", rowset id:" << rs_meta->rowset_id()
<< ", table size correctness check get inverted index v2 "
"size failed! msg:"
<< st.to_string()
<< ", inverted index path:" << inverted_index_file_path;
if (st.is<NOT_FOUND>()) {
LOG(INFO) << " tablet id: " << get_tablet_info().tablet_id
<< ", rowset id:" << rs_meta->rowset_id()
<< ", table size correctness check get inverted index v2 failed "
"because file not exist:"
<< inverted_index_file_path;
} else {
LOG(WARNING) << " tablet id: " << get_tablet_info().tablet_id
<< ", rowset id:" << rs_meta->rowset_id()
<< ", table size correctness check get inverted index v2 "
"size failed! msg:"
<< st.to_string()
<< ", inverted index path:" << inverted_index_file_path;
}
}
total_inverted_index_size += file_size;
}
Expand Down
3 changes: 1 addition & 2 deletions be/src/olap/tablet_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -948,8 +948,7 @@ Status TabletManager::load_tablet_from_dir(DataDir* store, TTabletId tablet_id,
bool exists = false;
RETURN_IF_ERROR(io::global_local_filesystem()->exists(header_path, &exists));
if (!exists) {
return Status::Error<FILE_NOT_EXIST>("fail to find header file. [header_path={}]",
header_path);
return Status::Error<NOT_FOUND>("fail to find header file. [header_path={}]", header_path);
}

TabletMetaSharedPtr tablet_meta(new TabletMeta());
Expand Down

0 comments on commit a4406ff

Please sign in to comment.