Skip to content

Commit 752d8c9

Browse files
[Fix] Sync Tablet::_cumulative_point to TabletMeta::_cumulative_layer_point
This commit fixes the issue where the cumulative_layer_point in TabletMeta was never synced with the in-memory _cumulative_point in Tablet, causing: 1. TabletMeta::_cumulative_layer_point was never updated after compaction 2. Tablet restart would lose the cumulative point progress Changes: - Tablet constructor now initializes _cumulative_point from TabletMeta - Tablet::save_meta() now syncs _cumulative_point to TabletMeta before saving Note: For snapshot/migration scenarios, the cumulative_layer_point will be persisted when the new tablet meta is saved after copy.
1 parent 9ec8abb commit 752d8c9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

be/src/olap/tablet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ Tablet::Tablet(StorageEngine& engine, TabletMetaSharedPtr tablet_meta, DataDir*
257257
_last_cumu_compaction_success_millis(0),
258258
_last_base_compaction_success_millis(0),
259259
_last_full_compaction_success_millis(0),
260-
_cumulative_point(K_INVALID_CUMULATIVE_POINT),
260+
_cumulative_point(_tablet_meta->cumulative_layer_point()),
261261
_newly_created_rowset_num(0),
262262
_last_checkpoint_time(0),
263263
_cumulative_compaction_type(cumulative_compaction_type),
@@ -337,6 +337,8 @@ Status Tablet::init() {
337337
// if it's a primary replica
338338
void Tablet::save_meta() {
339339
check_table_size_correctness();
340+
// Sync the in-memory cumulative point to tablet meta before saving
341+
_tablet_meta->set_cumulative_layer_point(_cumulative_point);
340342
auto res = _tablet_meta->save_meta(_data_dir);
341343
CHECK_EQ(res, Status::OK()) << "fail to save tablet_meta. res=" << res
342344
<< ", root=" << _data_dir->path();

0 commit comments

Comments
 (0)