Skip to content

Commit

Permalink
z
Browse files Browse the repository at this point in the history
Signed-off-by: CalvinNeo <[email protected]>
  • Loading branch information
CalvinNeo committed Jan 5, 2024
1 parent b947128 commit 34f63b4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub(crate) unsafe extern "C" fn ffi_apply_fap_snapshot(
"region_id" => region_id,
"peer_id" => peer_id,
);
if assert_exist {
if assert_exist != 0 {
panic!("should exist region_id={} peed_id={}", region_id, peer_id);
}
return 0;
Expand Down
20 changes: 10 additions & 10 deletions proxy_tests/proxy/shared/fast_add_peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ enum PauseType {
fn basic_fast_add_peer() {
tikv_util::set_panic_hook(true, "./");
let (mut cluster, pd_client) = new_mock_cluster(0, 2);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
// fail::cfg("on_pre_write_apply_state", "return").unwrap();
fail::cfg("fap_mock_fake_snapshot", "return(1)").unwrap();
Expand Down Expand Up @@ -67,7 +67,7 @@ fn test_overlap_last_apply_old() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3);
pd_client.disable_default_operator();
disable_auto_gen_compact_log(&mut cluster);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
tikv_util::set_panic_hook(true, "./");
// Can always apply snapshot immediately
Expand Down Expand Up @@ -198,7 +198,7 @@ fn test_overlap_apply_legacy_in_the_middle() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3);
pd_client.disable_default_operator();
disable_auto_gen_compact_log(&mut cluster);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
cluster.cfg.tikv.raft_store.store_batch_system.pool_size = 4;
cluster.cfg.tikv.raft_store.apply_batch_system.pool_size = 4;
Expand Down Expand Up @@ -350,7 +350,7 @@ fn simple_fast_add_peer(
// The case in TiFlash is (DelayedPeer, false, Build)
tikv_util::set_panic_hook(true, "./");
let (mut cluster, pd_client) = new_mock_cluster(0, 3);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
if !check_timeout {
fail::cfg("fap_core_fallback_millis", "return(1000000)").unwrap();
Expand Down Expand Up @@ -766,7 +766,7 @@ fn test_existing_peer() {

tikv_util::set_panic_hook(true, "./");
let (mut cluster, pd_client) = new_mock_cluster(0, 2);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
// fail::cfg("on_pre_write_apply_state", "return").unwrap();
disable_auto_gen_compact_log(&mut cluster);
Expand Down Expand Up @@ -815,7 +815,7 @@ fn test_existing_peer() {
fn test_apply_snapshot() {
tikv_util::set_panic_hook(true, "./");
let (mut cluster, pd_client) = new_mock_cluster(0, 3);
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;
// fail::cfg("on_pre_write_apply_state", "return").unwrap();
disable_auto_gen_compact_log(&mut cluster);
Expand Down Expand Up @@ -895,7 +895,7 @@ fn test_apply_snapshot() {
fn test_split_no_fast_add() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3);
pd_client.disable_default_operator();
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;

tikv_util::set_panic_hook(true, "./");
Expand Down Expand Up @@ -938,7 +938,7 @@ fn test_split_no_fast_add() {
fn test_split_merge() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3);
pd_client.disable_default_operator();
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;

tikv_util::set_panic_hook(true, "./");
Expand Down Expand Up @@ -991,7 +991,7 @@ fn test_split_merge() {
fn test_fall_back_to_slow_path() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 2);
pd_client.disable_default_operator();
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;

tikv_util::set_panic_hook(true, "./");
Expand Down Expand Up @@ -1030,7 +1030,7 @@ fn test_fall_back_to_slow_path() {
fn test_single_replica_migrate() {
let (mut cluster, pd_client) = new_mock_cluster_snap(0, 3);
pd_client.disable_default_operator();
fail::cfg("post_apply_snapshot_allow_no_unips", "").unwrap();
fail::cfg("post_apply_snapshot_allow_no_unips", "return").unwrap();
cluster.cfg.proxy_cfg.engine_store.enable_fast_add_peer = true;

tikv_util::set_panic_hook(true, "./");
Expand Down

0 comments on commit 34f63b4

Please sign in to comment.