Skip to content

Commit

Permalink
fix(storage): fix commit_epoch correct_sst
Browse files Browse the repository at this point in the history
  • Loading branch information
Li0k committed Sep 5, 2024
1 parent 7da40e6 commit ce1d7cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/meta/src/hummock/manager/commit_epoch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use std::sync::Arc;

use risingwave_common::catalog::TableId;
use risingwave_hummock_sdk::change_log::ChangeLogDelta;
use risingwave_hummock_sdk::compaction_group::group_split::split_sst;
use risingwave_hummock_sdk::compaction_group::group_split::{self, split_sst};
use risingwave_hummock_sdk::sstable_info::SstableInfo;
use risingwave_hummock_sdk::table_stats::{
add_prost_table_stats_map, purge_prost_table_stats, to_prost_table_stats_map, PbTableStatsMap,
Expand Down Expand Up @@ -477,7 +477,9 @@ impl HummockManager {
for (mut sst, group_table_ids) in sst_to_cg_vec {
for (group_id, match_ids) in group_table_ids {
let group_members_table_ids = group_members_table_ids.get(&group_id).unwrap();
if match_ids
if sst
.sst_info
.table_ids
.iter()
.all(|id| group_members_table_ids.contains(&TableId::new(*id)))
{
Expand All @@ -504,7 +506,6 @@ impl HummockManager {
split_key,
origin_sst_size - new_sst_size,
new_sst_size,
// match_ids,
);

commit_sstables
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -824,9 +824,11 @@ pub fn is_table_low_write_throughput(
if let Some(history) = table_write_throughput.get(&table_id) {
// Determine if 2/3 of the values in the interval below the threshold.
let mut low_write_throughput_count = 0;
for throughput in history.iter().skip(history.len() - window_size) {
if *throughput / checkpoint_secs < threshold {
low_write_throughput_count += 1;
if history.len() >= window_size {
for throughput in history.iter().skip(history.len() - window_size) {
if *throughput / checkpoint_secs < threshold {
low_write_throughput_count += 1;
}
}
}

Expand Down

0 comments on commit ce1d7cc

Please sign in to comment.