[Fix](partition) Skip rowset partition id eq 0 smaller than config wh… (#29510)
This commit is contained in:
@ -409,6 +409,12 @@ Status DataDir::load() {
|
||||
RETURN_IF_ERROR(_meta->put(META_COLUMN_FAMILY_INDEX, key, result));
|
||||
}
|
||||
}
|
||||
|
||||
if (rowset_meta->partition_id() == 0) {
|
||||
LOG(WARNING) << "rs tablet=" << rowset_meta->tablet_id() << " rowset_id=" << rowset_id
|
||||
<< " load from meta but partition id eq 0";
|
||||
}
|
||||
|
||||
dir_rowset_metas.push_back(rowset_meta);
|
||||
return true;
|
||||
};
|
||||
@ -497,6 +503,19 @@ Status DataDir::load() {
|
||||
RETURN_IF_ERROR(
|
||||
TabletMetaManager::traverse_pending_publish(_meta, load_pending_publish_info_func));
|
||||
|
||||
int64_t rowset_partition_id_eq_0_num = 0;
|
||||
for (auto rowset_meta : dir_rowset_metas) {
|
||||
if (rowset_meta->partition_id() == 0) {
|
||||
++rowset_partition_id_eq_0_num;
|
||||
}
|
||||
}
|
||||
if (rowset_partition_id_eq_0_num > config::ignore_invalid_partition_id_rowset_num) {
|
||||
LOG(FATAL) << fmt::format(
|
||||
"roswet partition id eq 0 bigger than config {}, be exit, plz check be.INFO",
|
||||
config::ignore_invalid_partition_id_rowset_num);
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
// traverse rowset
|
||||
// 1. add committed rowset to txn map
|
||||
// 2. add visible rowset to tablet
|
||||
@ -513,6 +532,13 @@ Status DataDir::load() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rowset_meta->partition_id() == 0) {
|
||||
LOG(WARNING) << "skip tablet_id=" << tablet->tablet_id()
|
||||
<< " rowset: " << rowset_meta->rowset_id()
|
||||
<< " txn: " << rowset_meta->txn_id();
|
||||
continue;
|
||||
}
|
||||
|
||||
RowsetSharedPtr rowset;
|
||||
Status create_status = tablet->create_rowset(rowset_meta, &rowset);
|
||||
if (!create_status) {
|
||||
@ -528,7 +554,7 @@ Status DataDir::load() {
|
||||
rowset_meta->set_tablet_schema(tablet->tablet_schema());
|
||||
RETURN_IF_ERROR(RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(),
|
||||
rowset_meta->rowset_id(),
|
||||
rowset_meta->get_rowset_pb()));
|
||||
rowset_meta->get_rowset_pb(), false));
|
||||
}
|
||||
Status commit_txn_status = _txn_manager->commit_txn(
|
||||
_meta, rowset_meta->partition_id(), rowset_meta->txn_id(),
|
||||
@ -561,7 +587,7 @@ Status DataDir::load() {
|
||||
rowset_meta->set_tablet_schema(tablet->tablet_schema());
|
||||
RETURN_IF_ERROR(RowsetMetaManager::save(_meta, rowset_meta->tablet_uid(),
|
||||
rowset_meta->rowset_id(),
|
||||
rowset_meta->get_rowset_pb()));
|
||||
rowset_meta->get_rowset_pb(), false));
|
||||
}
|
||||
Status publish_status = tablet->add_rowset(rowset);
|
||||
if (!publish_status && !publish_status.is<PUSH_VERSION_ALREADY_EXIST>()) {
|
||||
|
||||
Reference in New Issue
Block a user