Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions be/src/olap/olap_table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ OLAPStatus OLAPTable::load() {
res = load_indices();

if (res != OLAP_SUCCESS) {
LOG(FATAL) << "fail to load indices. [res=" << res << " table='" << _full_name << "']";
goto EXIT;
LOG(WARNING) << "fail to load indices. [res=" << res << " table='" << _full_name << "']";
return res;
}

// delete unused files
Expand All @@ -337,6 +337,7 @@ OLAPStatus OLAPTable::load() {

EXIT:
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "tablet load failed. drop tablet:" << _full_name;
OLAPEngine::get_instance()->drop_table(tablet_id(), schema_hash());
}

Expand Down
12 changes: 12 additions & 0 deletions be/src/olap/segment_group.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,24 @@ OLAPStatus SegmentGroup::validate() {
string data_path = construct_data_file_path(_segment_group_id, seg_id);

// 检查index文件头
if (!boost::filesystem::exists(index_path)) {
LOG(WARNING) << "tmp index_path not exist:" << index_path
<< ", tablet_id:" << _table->tablet_id()
<< ", schema_hash:" << _table->schema_hash();
}

if ((res = index_file_header.validate(index_path)) != OLAP_SUCCESS) {
LOG(WARNING) << "validate index file error. [file='" << index_path << "']";
_check_io_error(res);
return res;
}

if (!boost::filesystem::exists(data_path)) {
LOG(WARNING) << "tmp data_path not exist:" << data_path
<< ", tablet_id:" << _table->tablet_id()
<< ", schema_hash:" << _table->schema_hash();
}

// 检查data文件头
if ((res = data_file_header.validate(data_path)) != OLAP_SUCCESS) {
LOG(WARNING) << "validate data file error. [file='" << data_path << "']";
Expand Down
6 changes: 6 additions & 0 deletions be/src/olap/store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,12 @@ OLAPStatus OlapStore::_load_table_from_header(OLAPEngine* engine, TTabletId tabl
return OLAP_ERR_TABLE_INDEX_VALIDATE_ERROR;
}

res = olap_table->load();
if (res != OLAP_SUCCESS) {
LOG(WARNING) << "load tablet failed: tablet:" << olap_table->full_name() << ", res:" << res;
return OLAP_ERR_TABLE_INDEX_VALIDATE_ERROR;
}

res = engine->add_table(tablet_id, schema_hash, olap_table);
if (res != OLAP_SUCCESS) {
// insert existed tablet return OLAP_SUCCESS
Expand Down