[bug](cooldown) Fix incorrect remote rowset dir after restarting BE (#28140)

This commit is contained in:
plat1ko
2023-12-10 00:44:01 +08:00
committed by GitHub
parent 5aa90a3bce
commit a3cd36ce60
2 changed files with 10 additions and 11 deletions

View File

@ -525,8 +525,7 @@ Status SingleReplicaCompaction::_finish_clone(const string& clone_dir,
LOG(WARNING) << "version not found in cloned tablet meta when do single compaction";
return Status::InternalError("version not found in cloned tablet meta");
}
res = RowsetFactory::create_rowset(_tablet->tablet_schema(), _tablet->tablet_path(),
output_rs_meta, &_output_rowset);
res = _tablet->create_rowset(output_rs_meta, &_output_rowset);
if (!res.ok()) {
LOG(WARNING) << "fail to init rowset. version=" << output_version;
return res;

View File

@ -302,8 +302,7 @@ Status Tablet::_init_once_action() {
for (const auto& rs_meta : _tablet_meta->all_rs_metas()) {
Version version = rs_meta->version();
RowsetSharedPtr rowset;
res = RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), _tablet_path, rs_meta,
&rowset);
res = create_rowset(rs_meta, &rowset);
if (!res.ok()) {
LOG(WARNING) << "fail to init rowset. tablet_id=" << tablet_id()
<< ", schema_hash=" << schema_hash() << ", version=" << version
@ -314,11 +313,10 @@ Status Tablet::_init_once_action() {
}
// init stale rowset
for (auto& stale_rs_meta : _tablet_meta->all_stale_rs_metas()) {
for (const auto& stale_rs_meta : _tablet_meta->all_stale_rs_metas()) {
Version version = stale_rs_meta->version();
RowsetSharedPtr rowset;
res = RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), _tablet_path,
stale_rs_meta, &rowset);
res = create_rowset(stale_rs_meta, &rowset);
if (!res.ok()) {
LOG(WARNING) << "fail to init stale rowset. tablet_id:" << tablet_id()
<< ", schema_hash:" << schema_hash() << ", version=" << version
@ -2074,8 +2072,10 @@ void Tablet::_init_context_common_fields(RowsetWriterContext& context) {
}
Status Tablet::create_rowset(const RowsetMetaSharedPtr& rowset_meta, RowsetSharedPtr* rowset) {
return RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), tablet_path(), rowset_meta,
rowset);
return RowsetFactory::create_rowset(
_tablet_meta->tablet_schema(),
rowset_meta->is_local() ? _tablet_path : remote_tablet_path(tablet_id()), rowset_meta,
rowset);
}
Status Tablet::cooldown() {
@ -2371,8 +2371,8 @@ Status Tablet::_follow_cooldowned_data() {
auto rs_meta = std::make_shared<RowsetMeta>();
rs_meta->init_from_pb(*rs_pb_it);
RowsetSharedPtr rs;
RETURN_IF_ERROR(RowsetFactory::create_rowset(_tablet_meta->tablet_schema(),
_tablet_path, rs_meta, &rs));
RETURN_IF_ERROR(RowsetFactory::create_rowset(
_tablet_meta->tablet_schema(), remote_tablet_path(tablet_id()), rs_meta, &rs));
to_add.push_back(std::move(rs));
}
// Note: We CANNOT call `modify_rowsets` here because `modify_rowsets` cannot process version graph correctly.