Skip to content

Commit

Permalink
adapt
Browse files Browse the repository at this point in the history
Signed-off-by: Calvin Neo <calvinneo1995@gmail.com>
  • Loading branch information
CalvinNeo committed Jan 21, 2025
1 parent a89e7c1 commit 3f2efb3
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use std::{

use collections::{HashMap, HashSet};
use encryption::DataKeyManager;
use engine_traits::Iterator;
// mock cluster
use engine_traits::{Engines, KvEngine, CF_DEFAULT};
use file_system::IoRateLimiter;
Expand Down Expand Up @@ -79,7 +78,7 @@ impl Drop for CallbackLeakDetector {

debug!("before capture");
let bt = std::backtrace::Backtrace::capture();
warn!("callback is dropped"; "backtrace" => ?bt);
debug!("callback is dropped"; "backtrace" => ?bt);
}
}

Expand Down
13 changes: 10 additions & 3 deletions proxy_components/proxy_server/src/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ use kvproto::{
raft_serverpb::RaftMessage,
};
use pd_client::{PdClient, RpcClient};
use raft::eraftpb::MessageType;
use raft_log_engine::RaftLogEngine;
use raftstore::{
coprocessor::{config::SplitCheckConfigManager, CoprocessorHost, RegionInfoAccessor},
Expand Down Expand Up @@ -139,15 +140,20 @@ impl TiFlashGrpcMessageFilter {
}

impl RaftGrpcMessageFilter for TiFlashGrpcMessageFilter {
fn should_reject_raft_message(&self, _: &RaftMessage) -> bool {
fn should_reject_raft_message(&self, m: &RaftMessage) -> bool {
fail::fail_point!("tiflash_force_reject_raft_append_message", |_| true);

if self.reject_messages_on_memory_ratio < f64::EPSILON {
return false;
}

if m.get_message().get_msg_type() != MessageType::MsgAppend {
return false;
}

let mut usage = 0;
memory_usage_reaches_high_water(&mut usage)
let b = memory_usage_reaches_high_water(&mut usage);
b
}

fn should_reject_snapshot(&self) -> bool {
Expand All @@ -158,7 +164,8 @@ impl RaftGrpcMessageFilter for TiFlashGrpcMessageFilter {
}

let mut usage = 0;
memory_usage_reaches_high_water(&mut usage)
let b = memory_usage_reaches_high_water(&mut usage);
b
}
}

Expand Down
1 change: 1 addition & 0 deletions proxy_scripts/ci_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ elif [[ $M == "testnew" ]]; then
export ENGINE_LABEL_VALUE=tiflash
export RUST_BACKTRACE=full
export ENABLE_FEATURES="test-engine-kv-rocksdb test-engine-raft-raft-engine openssl-vendored"
export LOG_LEVEL=INFO
cargo check --package proxy_server --features="$ENABLE_FEATURES"
# tests based on mock-engine-store, with compat for new proxy
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib cargo test --package proxy_tests --features="$ENABLE_FEATURES" --test proxy shared::jemalloc --features="jemalloc"
Expand Down

0 comments on commit 3f2efb3

Please sign in to comment.