Skip to content

Support on_apply_snapshot_committed to delete useless FAP snapshot #428

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

CalvinNeo
Copy link
Member

What is changed and how it works?

Issue Number: Close #xxx

What's Changed:


Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Release note


Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
@ti-chi-bot ti-chi-bot bot added the size/XXL label Mar 17, 2025
@JaySon-Huang
Copy link
Collaborator

Does the test need to be updated? Or something wrong with the logic?

https://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/pingcap_tidb-engine-ext/428/pull-unit-test/1901501665530351616#1:build-log.txt%3A12376

test_fall_back_to_slow_path 2025/03/17 13:45:36.728 lib.rs:480: [CRIT] assertion `left == right` failed
  left: Persisted
 right: NotFound, backtrace:    0: tikv_util::set_panic_hook::{{closure}}
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/components/tikv_util/src/lib.rs:479:18
...
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/panicking.rs:297:5
   8: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path::{{closure}}
             at proxy/shared/fast_add_peer/fp.rs:875:9
   9: mock_engine_store::mock_cluster::cluster_ext::ClusterExt::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/cluster_ext.rs:243:21
  10: mock_engine_store::mock_cluster::v1::<impl mock_engine_store::mock_cluster::mixed_cluster::MixedCluster for mock_engine_store::mock_cluster::v1::cluster::Cluster<T>>::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/v1/mod.rs:110:28
  11: mock_engine_store::mock_cluster::test_utils::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/test_utils.rs:51:5
  12: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path
             at proxy/shared/fast_add_peer/fp.rs:874:5
  13: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path::{{closure}}
             at proxy/shared/fast_add_peer/fp.rs:842:33
  14: core::ops::function::FnOnce::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/ops/function.rs:250:5
  15: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/components/test_util/src/runner.rs:64:21
...
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/ops/function.rs:250:5
  21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/alloc/src/boxed.rs:2015:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/alloc/src/boxed.rs:2015:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/std/src/sys/unix/thread.rs:108:17
  22: start_thread
  23: clone
, location: proxy_tests/proxy/shared/fast_add_peer/fp.rs:875, thread_name: shared::fast_add_peer::fp::test_fall_back_to_slow_path, thread_id: 8

@CalvinNeo CalvinNeo changed the title On apply snapshot committed [DNM] On apply snapshot committed Mar 31, 2025
Signed-off-by: Calvin Neo <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/XL and removed size/XXL labels Mar 31, 2025
@CalvinNeo
Copy link
Member Author

Does the test need to be updated? Or something wrong with the logic?

https://prow.tidb.net/view/gs/prow-tidb-logs/pr-logs/pull/pingcap_tidb-engine-ext/428/pull-unit-test/1901501665530351616#1:build-log.txt%3A12376

test_fall_back_to_slow_path 2025/03/17 13:45:36.728 lib.rs:480: [CRIT] assertion `left == right` failed
  left: Persisted
 right: NotFound, backtrace:    0: tikv_util::set_panic_hook::{{closure}}
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/components/tikv_util/src/lib.rs:479:18
...
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/panicking.rs:297:5
   8: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path::{{closure}}
             at proxy/shared/fast_add_peer/fp.rs:875:9
   9: mock_engine_store::mock_cluster::cluster_ext::ClusterExt::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/cluster_ext.rs:243:21
  10: mock_engine_store::mock_cluster::v1::<impl mock_engine_store::mock_cluster::mixed_cluster::MixedCluster for mock_engine_store::mock_cluster::v1::cluster::Cluster<T>>::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/v1/mod.rs:110:28
  11: mock_engine_store::mock_cluster::test_utils::iter_ffi_helpers
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/proxy_components/mock-engine-store/src/mock_cluster/test_utils.rs:51:5
  12: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path
             at proxy/shared/fast_add_peer/fp.rs:874:5
  13: proxy::shared::fast_add_peer::fp::test_fall_back_to_slow_path::{{closure}}
             at proxy/shared/fast_add_peer/fp.rs:842:33
  14: core::ops::function::FnOnce::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/ops/function.rs:250:5
  15: test_util::runner::run_test_with_hook::{{closure}}::{{closure}}
             at /home/prow/go/src/github.com/pingcap/tidb-engine-ext/components/test_util/src/runner.rs:64:21
...
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/core/src/ops/function.rs:250:5
  21: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/alloc/src/boxed.rs:2015:9
      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/alloc/src/boxed.rs:2015:9
      std::sys::unix::thread::Thread::new::thread_start
             at /rustc/89e2160c4ca5808657ed55392620ed1dbbce78d1/library/std/src/sys/unix/thread.rs:108:17
  22: start_thread
  23: clone
, location: proxy_tests/proxy/shared/fast_add_peer/fp.rs:875, thread_name: shared::fast_add_peer::fp::test_fall_back_to_slow_path, thread_id: 8

They should be adapted, by enabling on_apply_snapshot_committed_allow_no_unips failpoint.

Signed-off-by: Calvin Neo <[email protected]>
@CalvinNeo
Copy link
Member Author

/retest

@CalvinNeo
Copy link
Member Author

/hold Do not merge this PR, because we should have merged the observer into tikv master first

Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
@CalvinNeo CalvinNeo changed the title [DNM] On apply snapshot committed On apply snapshot committed May 21, 2025
@CalvinNeo CalvinNeo changed the title On apply snapshot committed Support on_apply_snapshot_committed to delete obselote FAP snapshot May 21, 2025
@CalvinNeo CalvinNeo changed the title Support on_apply_snapshot_committed to delete obselote FAP snapshot Support on_apply_snapshot_committed to delete obsolete FAP snapshot May 21, 2025
@CalvinNeo CalvinNeo changed the title Support on_apply_snapshot_committed to delete obsolete FAP snapshot Support on_apply_snapshot_committed to delete useless FAP snapshot May 21, 2025
CalvinNeo added 2 commits May 21, 2025 10:21
Signed-off-by: Calvin Neo <[email protected]>
Signed-off-by: Calvin Neo <[email protected]>
CalvinNeo and others added 2 commits May 21, 2025 13:18
CalvinNeo added 2 commits May 21, 2025 14:53
…db-engine-ext into on_apply_snapshot_committed
Signed-off-by: Calvin Neo <[email protected]>
@CalvinNeo CalvinNeo requested a review from JaySon-Huang May 21, 2025 09:22
@CalvinNeo
Copy link
Member Author

image

Copy link
Collaborator

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ti-chi-bot ti-chi-bot bot added the lgtm label May 22, 2025
Copy link

ti-chi-bot bot commented May 22, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link

ti-chi-bot bot commented May 22, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-05-22 07:22:35.54421271 +0000 UTC m=+77059.961272258: ☑️ agreed by JaySon-Huang.

@ti-chi-bot ti-chi-bot bot added the approved label May 22, 2025
@CalvinNeo
Copy link
Member Author

/unhold

@ti-chi-bot ti-chi-bot bot merged commit 3e325b2 into pingcap:raftstore-proxy May 22, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants