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

tikv crash: Cannot compare two ScalarValueRef in different type #24395

Closed
marsishandsome opened this issue Apr 30, 2021 · 2 comments
Closed

tikv crash: Cannot compare two ScalarValueRef in different type #24395

marsishandsome opened this issue Apr 30, 2021 · 2 comments
Assignees
Labels
severity/critical sig/execution SIG execution type/bug This issue is a bug.

Comments

@marsishandsome
Copy link
Contributor

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

CREATE TABLE t (
  `id_dt` int(11) NOT NULL,
  `tp_enum` enum('1','2','3','4') DEFAULT NULL
  );
  insert into t values(1, 1);
  select id_dt, tp_enum from t order by tp_enum desc, id_dt limit 10;

2. What did you expect to see? (Required)

+-------+---------+
| id_dt | tp_enum |
+-------+---------+
|     1 | 1       |
+-------+---------+

3. What did you see instead (Required)

ERROR 9002 (HY000): TiKV server timeout

4. What is your TiDB version? (Required)

Release Version: v4.0.0-beta.2-2780-gc5ca2ea7f
Edition: Community
Git Commit Hash: c5ca2ea7f91786f682c448aebfd07513af20c40e
Git Branch: master
UTC Build Time: 2021-04-29 16:36:57
GoVersion: go1.13
Race Enabled: false
TiKV Min Version: v3.0.0-60965b006877ca7234adaced7890d7b029ed1306
Check Table Before Drop: false

5. tikv log

[FATAL] [lib.rs:452] ["Cannot compare two ScalarValueRef in different type"] [backtrace="stack backtrace:\n   0: tikv_util::set_panic_hook::{{closure}}\n             at components/tikv_util/src/lib.rs:451\n   1: std::panicking::rust_panic_with_hook\n             at library/std/src/panicking.rs:595\n   2: std::panicking::begin_panic::{{closure}}\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panicking.rs:520\n   3: std::sys_common::backtrace::__rust_end_short_backtrace\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/sys_common/backtrace.rs:141\n   4: std::panicking::begin_panic\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panicking.rs:519\n   5: tidb_query_datatype::codec::data_type::scalar::ScalarValueRef::cmp_sort_key\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_datatype/src/codec/data_type/scalar.rs:357\n      tidb_query_executors::top_n_executor::HeapItemUnsafe::cmp_sort_key\n             at components/tidb_query_executors/src/top_n_executor.rs:433\n   6: tidb_query_executors::top_n_executor::BatchTopNExecutor<Src>::heap_add_row\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/top_n_executor.rs:223\n      tidb_query_executors::top_n_executor::BatchTopNExecutor<Src>::process_batch_input\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/top_n_executor.rs:213\n      tidb_query_executors::top_n_executor::BatchTopNExecutor<Src>::handle_next_batch\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/top_n_executor.rs:162\n      <tidb_query_executors::top_n_executor::BatchTopNExecutor<Src> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/top_n_executor.rs:315\n      <tidb_query_common::execute_stats::WithSummaryCollector<C,T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/interface.rs:108\n   7: <alloc::boxed::Box<T> as tidb_query_executors::interface::BatchExecutor>::next_batch\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/interface.rs:77\n      tidb_query_executors::runner::BatchExecutorsRunner<SS>::internal_handle_request\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/runner.rs:529\n   8: tidb_query_executors::runner::BatchExecutorsRunner<SS>::handle_request::{{closure}}\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_executors/src/runner.rs:414\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/mod.rs:80\n      <tikv::coprocessor::dag::BatchDAGHandler as tikv::coprocessor::RequestHandler>::handle_request::__handle_request::{{closure}}\n             at src/coprocessor/dag/mod.rs:104\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/mod.rs:80\n   9: <core::pin::Pin<P> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/future.rs:120\n      <tikv::coprocessor::interceptors::tracker::Tracker<F> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/src/coprocessor/interceptors/tracker.rs:49\n      <tikv::coprocessor::interceptors::concurrency_limiter::ConcurrencyLimiter<PF,F> as core::future::future::Future>::poll\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/src/coprocessor/interceptors/concurrency_limiter.rs:101\n  10: tikv::coprocessor::endpoint::Endpoint<E>::handle_unary_request_impl::{{closure}}\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/src/coprocessor/endpoint.rs:421\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/mod.rs:80\n      tikv::read_pool::ReadPoolHandle::spawn_handle::{{closure}}\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/src/read_pool.rs:136\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/mod.rs:80\n  11: tikv::read_pool::ReadPoolHandle::spawn::{{closure}}\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/src/read_pool.rs:112\n      <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/future/mod.rs:80\n  12: <yatp::task::future::Runner as yatp::pool::runner::Runner>::handle\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/6bbea16/src/task/future.rs:261\n  13: <tikv_util::yatp_pool::YatpPoolRunner<T> as yatp::pool::runner::Runner>::handle\n             at /home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tikv_util/src/yatp_pool/mod.rs:93\n      <yatp::queue::multilevel::MultilevelRunner<R> as yatp::pool::runner::Runner>::handle\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/6bbea16/src/queue/multilevel.rs:245\n      yatp::pool::worker::WorkerThread<T,R>::run\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/6bbea16/src/pool/worker.rs:48\n      yatp::pool::builder::LazyBuilder<T>::build::{{closure}}\n             at /rust/git/checkouts/yatp-e704b73c3ee279b6/6bbea16/src/pool/builder.rs:91\n      std::sys_common::backtrace::__rust_begin_short_backtrace\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/sys_common/backtrace.rs:125\n  14: std::thread::Builder::spawn_unchecked::{{closure}}::{{closure}}\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/thread/mod.rs:474\n      <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panic.rs:344\n      std::panicking::try::do_call\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panicking.rs:379\n      std::panicking::try\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panicking.rs:343\n      std::panic::catch_unwind\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/panic.rs:431\n      std::thread::Builder::spawn_unchecked::{{closure}}\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/std/src/thread/mod.rs:473\n      core::ops::function::FnOnce::call_once{{vtable.shim}}\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/core/src/ops/function.rs:227\n  15: <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/alloc/src/boxed.rs:1546\n      <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once\n             at /rustc/16bf626a31cb5b121d0bca2baa969b4f67eb0dab/library/alloc/src/boxed.rs:1546\n      std::sys::unix::thread::Thread::new::thread_start\n             at library/std/src/sys/unix/thread.rs:71\n  16: start_thread\n  17: clone\n"] [location=/home/jenkins/agent/workspace/build_tikv_multi_branch_master/tikv/components/tidb_query_datatype/src/codec/data_type/scalar.rs:357] [thread_name=unified-read-pool-16]
@marsishandsome marsishandsome added the type/bug This issue is a bug. label Apr 30, 2021
marsishandsome added a commit to marsishandsome/tispark that referenced this issue Apr 30, 2021
marsishandsome added a commit to pingcap/tispark that referenced this issue Apr 30, 2021
ti-srebot pushed a commit to ti-srebot/tispark that referenced this issue Apr 30, 2021
marsishandsome added a commit to pingcap/tispark that referenced this issue Apr 30, 2021
Co-authored-by: marsishandsome <marsishandsome@gmail.com>
@wshwsh12 wshwsh12 self-assigned this May 8, 2021
@wshwsh12
Copy link
Contributor

wshwsh12 commented May 8, 2021

Fixed by tikv/tikv#10101. Only master has this problem.

@wshwsh12 wshwsh12 closed this as completed May 8, 2021
@ti-srebot
Copy link
Contributor

Please edit this comment or add a new comment to complete the following information

Not a bug

  1. Remove the 'type/bug' label
  2. Add notes to indicate why it is not a bug

Duplicate bug

  1. Add the 'type/duplicate' label
  2. Add the link to the original bug

Bug

Note: Make Sure that 'component', and 'severity' labels are added
Example for how to fill out the template: #20100

1. Root Cause Analysis (RCA) (optional)

2. Symptom (optional)

3. All Trigger Conditions (optional)

4. Workaround (optional)

5. Affected versions

6. Fixed versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
severity/critical sig/execution SIG execution type/bug This issue is a bug.
Projects
None yet
Development

No branches or pull requests

4 participants