Skip to content

Commit

Permalink
[Fix](status) Fix wrong status check in data size check (#43545)
Browse files Browse the repository at this point in the history
  • Loading branch information
Yukang-Lian authored Nov 12, 2024
1 parent c2ac2cb commit aea1bd3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 8 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 @@ -119,7 +119,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
2 changes: 1 addition & 1 deletion be/src/olap/tablet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2833,7 +2833,7 @@ 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;
if (st.is<FILE_NOT_EXIST>()) {
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 "
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 @@ -955,8 +955,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 aea1bd3

Please sign in to comment.