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

panic: expecting pushing value of datatype Float64(Float64Type), actual Int64(1024) #2547

Closed
evenyag opened this issue Oct 9, 2023 · 1 comment · Fixed by #2548
Closed
Assignees
Labels
C-bug Category Bugs

Comments

@evenyag
Copy link
Contributor

evenyag commented Oct 9, 2023

What type of bug is this?

Crash

What subsystems are affected?

Datanode

What happened?

Invalid write requests may cause the write worker to panic.

What operating system did you use?

Unrelated

Relevant log output and stack trace

{"v":0,"name":"greptime-datanode","msg":"panicked at greptimedb/src/datatypes/src/vectors.rs:201:13:
expecting pushing value of datatype Float64(Float64Type), actual Int64(1024)","level":50,"hostname":"greptimedb-datanode-1","pid":1,"time":"2023-10-08T09:13:37.332877082Z","target":"common_telemetry::panic_hook","line":34,"file":"greptimedb/src/common/telemetry/src/panic_hook.rs","panic.file":"greptimedb/src/datatypes/src/vectors.rs","panic.column":13,"backtrace":"   0: common_telemetry::panic_hook::set_panic_hook::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/common/telemetry/src/panic_hook.rs:31:25
   1: <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/alloc/src/boxed.rs:2021:9
      std::panicking::rust_panic_with_hook
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/std/src/panicking.rs:733:13
   2: std::panicking::begin_panic_handler::{{closure}}
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/std/src/panicking.rs:621:13
   3: std::sys_common::backtrace::__rust_end_short_backtrace
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/std/src/sys_common/backtrace.rs:170:18
   4: rust_begin_unwind
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/std/src/panicking.rs:617:5
   5: core::panicking::panic_fmt
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/core/src/panicking.rs:67:14
   6: datatypes::vectors::MutableVector::push_value_ref::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/datatypes/src/vectors.rs:201:13
      core::result::Result<T,E>::unwrap_or_else
             at rustc/f3623871cfa0763c95ebd6ceafaa6dc2e44ca68f/library/core/src/result.rs:1429:23
      datatypes::vectors::MutableVector::push_value_ref
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/datatypes/src/vectors.rs:200:40
   7: mito2::memtable::time_series::ValueBuilder::push
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/memtable/time_series.rs:437:13
      mito2::memtable::time_series::Series::push
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/memtable/time_series.rs:343:9
      <mito2::memtable::time_series::TimeSeriesMemtable as mito2::memtable::Memtable>::write
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/memtable/time_series.rs:193:13
   8: mito2::region_write_ctx::RegionWriteCtx::write_memtable
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/region_write_ctx.rs:175:29
   9: mito2::worker::handle_write::<impl mito2::worker::RegionWorkerLoop<S>>::handle_write_requests::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/worker/handle_write.rs:78:13
  10: mito2::worker::RegionWorkerLoop<S>::handle_requests::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/worker.rs:509:58
      mito2::worker::RegionWorkerLoop<S>::run::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/worker.rs:472:47
      mito2::worker::WorkerStarter<S>::start::{{closure}}
             at home/runner/work/greptimedb-cloud/greptimedb-cloud/greptimedb/src/mito2/src/worker.rs:289:33
  11: tokio::runtime::task::core::Core<T,S>::poll::{{closure}}
             at home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/task/core.rs:334:17
      tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
             at home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/loom/std/unsafe_cell.rs:16:9
      tokio::runtime::task::core::Core<T,S>::poll
             at home/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.32.0/src/runtime/task/core.rs:323:13

How can we reproduce the bug?

Inserting some columns with invalid type.

@evenyag evenyag added the C-bug Category Bugs label Oct 9, 2023
@evenyag evenyag self-assigned this Oct 9, 2023
@evenyag
Copy link
Contributor Author

evenyag commented Oct 9, 2023

Root cause: We break the schema validation if there is a column to fill

} else {
// Rows don't have this column.
self.check_missing_column(column)?;
return FillDefaultSnafu { region_id }.fail();
}

So if users only provide a subset of columns in their insert request, we will skip schema validation once we find out a column is absent in input rows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category Bugs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant