@@ -302,8 +302,7 @@ Status Tablet::_init_once_action() {
302
302
for (const auto & rs_meta : _tablet_meta->all_rs_metas ()) {
303
303
Version version = rs_meta->version ();
304
304
RowsetSharedPtr rowset;
305
- res = RowsetFactory::create_rowset (_tablet_meta->tablet_schema (), _tablet_path, rs_meta,
306
- &rowset);
305
+ res = create_rowset (rs_meta, &rowset);
307
306
if (!res.ok ()) {
308
307
LOG (WARNING) << " fail to init rowset. tablet_id=" << tablet_id ()
309
308
<< " , schema_hash=" << schema_hash () << " , version=" << version
@@ -314,11 +313,10 @@ Status Tablet::_init_once_action() {
314
313
}
315
314
316
315
// 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 ()) {
318
317
Version version = stale_rs_meta->version ();
319
318
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);
322
320
if (!res.ok ()) {
323
321
LOG (WARNING) << " fail to init stale rowset. tablet_id:" << tablet_id ()
324
322
<< " , schema_hash:" << schema_hash () << " , version=" << version
@@ -2074,8 +2072,10 @@ void Tablet::_init_context_common_fields(RowsetWriterContext& context) {
2074
2072
}
2075
2073
2076
2074
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);
2079
2079
}
2080
2080
2081
2081
Status Tablet::cooldown () {
@@ -2371,8 +2371,8 @@ Status Tablet::_follow_cooldowned_data() {
2371
2371
auto rs_meta = std::make_shared<RowsetMeta>();
2372
2372
rs_meta->init_from_pb (*rs_pb_it);
2373
2373
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));
2376
2376
to_add.push_back (std::move (rs));
2377
2377
}
2378
2378
// Note: We CANNOT call `modify_rowsets` here because `modify_rowsets` cannot process version graph correctly.
0 commit comments