diff --git a/be/src/olap/olap_table.cpp b/be/src/olap/olap_table.cpp index 2a52a2c2883d3e..08d2ed002cf688 100644 --- a/be/src/olap/olap_table.cpp +++ b/be/src/olap/olap_table.cpp @@ -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 @@ -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()); } diff --git a/be/src/olap/segment_group.cpp b/be/src/olap/segment_group.cpp index fdabc9bc2fd705..7b689e26af7601 100644 --- a/be/src/olap/segment_group.cpp +++ b/be/src/olap/segment_group.cpp @@ -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 << "']"; diff --git a/be/src/olap/store.cpp b/be/src/olap/store.cpp index b5a801f83bf1e1..4d15ff4ee729ef 100755 --- a/be/src/olap/store.cpp +++ b/be/src/olap/store.cpp @@ -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