Skip to content
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

fix: avoid break when drop wal table failed #806

Merged
merged 3 commits into from
Apr 4, 2023

Conversation

MichaelLeeHZ
Copy link
Contributor

Which issue does this PR close?

Closes #

Rationale for this change

It occurs error when dropping expired wal table.

2023-04-04 12:08:40.363 ERRO [components/table_kv/src/obkv.rs:439] Failed to drop table, table_name:wal_wal_20230317000000_000003, err:Table not dropped, table:wal_wal_20230317000000_000003.
Backtrace:
0 <snafu::backtrace_shim::Backtrace as snafu::GenerateBacktrace>::generate::hfa679d2c718d0b38
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/snafu-0.6.10/src/backtrace_shim.rs:15
  table_kv::obkv::TableNotDropped<__T0>::build::hf3dea826ebd60599
  /xunming/ceresdb/components/table_kv/src/obkv.rs:23
  table_kv::obkv::TableNotDropped<__T0>::fail::hfb145a30c5888703
  /xunming/ceresdb/components/table_kv/src/obkv.rs:23
  table_kv::obkv::ObkvImpl::try_drop_kv_table::h7edb8769b0ed116c
  /xunming/ceresdb/components/table_kv/src/obkv.rs:374
  <table_kv::obkv::ObkvImpl as table_kv::TableKv>::drop_table::h3b83a7345d116784
  /xunming/ceresdb/components/table_kv/src/obkv.rs:438
1 wal::table_kv_impl::namespace::purge_buckets::hb4395adb5b50e83e
  /xunming/ceresdb/wal/src/table_kv_impl/namespace.rs:1444
2 wal::table_kv_impl::namespace::NamespaceInner<T>::load_buckets::{{closure}}::h4922baf7634505ad
  /xunming/ceresdb/wal/src/table_kv_impl/namespace.rs:354
  <tokio::runtime::blocking::task::BlockingTask<T> as core::future::future::Future>::poll::h270e8b114cddbb1b
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.25.0/src/runtime/blocking/task.rs:42
  tokio::runtime::task::core::Core<T,S>::poll::{{closure}}::hea44e76037d909f7
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.25.0/src/runtime/task/core.rs:223
  tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut::h24af6522353d4a69
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.25.0/src/loom/std/unsafe_cell.rs:14
  tokio::runtime::task::core::Core<T,S>::poll::h378d8040acaefa93
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.25.0/src/runtime/task/core.rs:212
  tokio::runtime::task::harness::poll_future::{{closure}}::h92d37d5647cfe3a6
  /root/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/tokio-1.25.0/src/runtime/task/harness.rs:476
  <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h3dc7a85ad1d5e8ec
  /rustc/11d96b59307b1702fffe871bfc2d0145d070881e/library/core/src/panic/unwind_safe.rs:271
  std::panicking::try::do_call::hd1d739daf4f7b5fa
  /rustc/11d96b59307b1702fffe871bfc2d0145d070881e/library/std/src/panicking.rs:483
  std::panicking::try::hd06767296cb7e461
  /rustc/11d96b59307b1702fffe871bfc2d0145d070881e/library/std/src/panicking.rs:447
  std::panic::catch_unwind::h51d62c40d2d54cda
  /rustc/11d96b59307b1702fffe871bfc2d0145d070881e/library/std/src/panic.rs:140

What changes are included in this PR?

Print error log when dropping expired wal table failed, and continue to drop other tables.

Are there any user-facing changes?

None

How does this change test

@MichaelLeeHZ MichaelLeeHZ marked this pull request as ready for review April 4, 2023 06:25
@codecov-commenter
Copy link

Codecov Report

Merging #806 (cdb582b) into main (0831a84) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head cdb582b differs from pull request most recent head c39df85. Consider uploading reports for the commit c39df85 to get more accurate results

@@           Coverage Diff           @@
##             main     #806   +/-   ##
=======================================
  Coverage   68.18%   68.18%           
=======================================
  Files         295      295           
  Lines       46880    46823   -57     
=======================================
- Hits        31963    31925   -38     
+ Misses      14917    14898   -19     
Impacted Files Coverage Δ
analytic_engine/src/instance/open.rs 80.69% <ø> (-0.06%) ⬇️
analytic_engine/src/manifest/details.rs 95.63% <ø> (-0.03%) ⬇️
catalog/src/schema.rs 78.26% <ø> (-0.91%) ⬇️
catalog_impls/src/table_based.rs 83.43% <ø> (-0.03%) ⬇️
...nterpreters/src/table_manipulator/catalog_based.rs 98.13% <ø> (-0.02%) ⬇️
server/src/grpc/meta_event_service/mod.rs 0.00% <ø> (ø)
system_catalog/src/sys_catalog_table.rs 92.19% <ø> (-0.03%) ⬇️
table_engine/src/engine.rs 55.07% <ø> (+0.78%) ⬆️
analytic_engine/src/table/data.rs 91.25% <100.00%> (-0.29%) ⬇️

... and 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Contributor

@Rachelint Rachelint left a comment

Choose a reason for hiding this comment

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

LGTM

@MichaelLeeHZ MichaelLeeHZ added this pull request to the merge queue Apr 4, 2023
Merged via the queue into apache:main with commit 9976a6f Apr 4, 2023
@MichaelLeeHZ MichaelLeeHZ deleted the fix_purge_wal_bucket_err branch April 4, 2023 07:39
chunshao90 pushed a commit to chunshao90/ceresdb that referenced this pull request May 15, 2023
* avoid break when drop wal failed

* polish

* fmt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants