Skip to content

Commit a3cd36c

Browse files
authored
[bug](cooldown) Fix incorrect remote rowset dir after restarting BE (apache#28140)
1 parent 5aa90a3 commit a3cd36c

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

be/src/olap/single_replica_compaction.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -525,8 +525,7 @@ Status SingleReplicaCompaction::_finish_clone(const string& clone_dir,
525525
LOG(WARNING) << "version not found in cloned tablet meta when do single compaction";
526526
return Status::InternalError("version not found in cloned tablet meta");
527527
}
528-
res = RowsetFactory::create_rowset(_tablet->tablet_schema(), _tablet->tablet_path(),
529-
output_rs_meta, &_output_rowset);
528+
res = _tablet->create_rowset(output_rs_meta, &_output_rowset);
530529
if (!res.ok()) {
531530
LOG(WARNING) << "fail to init rowset. version=" << output_version;
532531
return res;

be/src/olap/tablet.cpp

+9-9
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ Status Tablet::_init_once_action() {
302302
for (const auto& rs_meta : _tablet_meta->all_rs_metas()) {
303303
Version version = rs_meta->version();
304304
RowsetSharedPtr rowset;
305-
res = RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), _tablet_path, rs_meta,
306-
&rowset);
305+
res = create_rowset(rs_meta, &rowset);
307306
if (!res.ok()) {
308307
LOG(WARNING) << "fail to init rowset. tablet_id=" << tablet_id()
309308
<< ", schema_hash=" << schema_hash() << ", version=" << version
@@ -314,11 +313,10 @@ Status Tablet::_init_once_action() {
314313
}
315314

316315
// init stale rowset
317-
for (auto& stale_rs_meta : _tablet_meta->all_stale_rs_metas()) {
316+
for (const auto& stale_rs_meta : _tablet_meta->all_stale_rs_metas()) {
318317
Version version = stale_rs_meta->version();
319318
RowsetSharedPtr rowset;
320-
res = RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), _tablet_path,
321-
stale_rs_meta, &rowset);
319+
res = create_rowset(stale_rs_meta, &rowset);
322320
if (!res.ok()) {
323321
LOG(WARNING) << "fail to init stale rowset. tablet_id:" << tablet_id()
324322
<< ", schema_hash:" << schema_hash() << ", version=" << version
@@ -2074,8 +2072,10 @@ void Tablet::_init_context_common_fields(RowsetWriterContext& context) {
20742072
}
20752073

20762074
Status Tablet::create_rowset(const RowsetMetaSharedPtr& rowset_meta, RowsetSharedPtr* rowset) {
2077-
return RowsetFactory::create_rowset(_tablet_meta->tablet_schema(), tablet_path(), rowset_meta,
2078-
rowset);
2075+
return RowsetFactory::create_rowset(
2076+
_tablet_meta->tablet_schema(),
2077+
rowset_meta->is_local() ? _tablet_path : remote_tablet_path(tablet_id()), rowset_meta,
2078+
rowset);
20792079
}
20802080

20812081
Status Tablet::cooldown() {
@@ -2371,8 +2371,8 @@ Status Tablet::_follow_cooldowned_data() {
23712371
auto rs_meta = std::make_shared<RowsetMeta>();
23722372
rs_meta->init_from_pb(*rs_pb_it);
23732373
RowsetSharedPtr rs;
2374-
RETURN_IF_ERROR(RowsetFactory::create_rowset(_tablet_meta->tablet_schema(),
2375-
_tablet_path, rs_meta, &rs));
2374+
RETURN_IF_ERROR(RowsetFactory::create_rowset(
2375+
_tablet_meta->tablet_schema(), remote_tablet_path(tablet_id()), rs_meta, &rs));
23762376
to_add.push_back(std::move(rs));
23772377
}
23782378
// Note: We CANNOT call `modify_rowsets` here because `modify_rowsets` cannot process version graph correctly.

0 commit comments

Comments
 (0)