Skip to content

larger table causes overflow deep in arrow land #3767

@rtyler

Description

@rtyler

Environment

Delta-rs version: 0.28.1

Binding: 🦀


Bug

What happened:

thread 'main' (3742440) panicked at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-55.2.0/src/builder/generic_bytes_builder.rs:164:35:
attempt to add with overflow

This occurs when opening a table that has ~5.9GB of transaction log data, which I don't consider particularly large 😄

What you expected to happen:

Well, not panic obviously 😆

How to reproduce it:

Work at my company, and then open this specific table 😆 The backtrace shows:

thread 'main' (3742440) panicked at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-55.2.0/src/builder/generic_bytes_builder.rs:164:35:
attempt to add with overflow
stack backtrace:
   0: __rustc::rust_begin_unwind
             at /rustc/69b76df90c7ea63b5350d1865f92902a0b27c9a2/library/std/src/panicking.rs:698:5
   1: core::panicking::panic_fmt
             at /rustc/69b76df90c7ea63b5350d1865f92902a0b27c9a2/library/core/src/panicking.rs:75:14
   2: core::panicking::panic_const::panic_const_add_overflow
             at /rustc/69b76df90c7ea63b5350d1865f92902a0b27c9a2/library/core/src/panicking.rs:175:17
   3: <i32 as core::ops::arith::Add>::add
             at /rustc/69b76df90c7ea63b5350d1865f92902a0b27c9a2/library/core/src/ops/arith.rs:106:45
   4: arrow_array::builder::generic_bytes_builder::GenericByteBuilder<T>::append_array
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-array-55.2.0/src/builder/generic_bytes_builder.rs:164:35
   5: arrow_select::concat::concat_bytes
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-select-55.2.0/src/concat.rs:239:17
   6: arrow_select::concat::concat
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-select-55.2.0/src/concat.rs:425:27
   7: arrow_select::concat::concat_batches
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/arrow-select-55.2.0/src/concat.rs:488:21
   8: deltalake_core::kernel::snapshot::EagerSnapshot::try_new::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/kernel/snapshot/mod.rs:464:21
   9: deltalake_core::table::state::DeltaTableState::try_new::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/table/state.rs:45:75
  10: deltalake_core::table::DeltaTable::update_incremental::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/table/mod.rs:193:26
  11: deltalake_core::table::DeltaTable::load::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/table/mod.rs:173:39
  12: deltalake_core::table::builder::DeltaTableBuilder::load::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/table/builder.rs:291:50
  13: deltalake_core::open_table::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/deltalake-core-0.28.1/src/lib.rs:118:70
  14: launch::main::{{closure}}
             at ./launch.rs:24:66
  15: tokio::runtime::park::CachedParkThread::block_on::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/park.rs:285:71
  16: tokio::task::coop::with_budget
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/task/coop/mod.rs:167:5
  17: tokio::task::coop::budget
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/task/coop/mod.rs:133:5
  18: tokio::runtime::park::CachedParkThread::block_on
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/park.rs:285:31
  19: tokio::runtime::context::blocking::BlockingRegionGuard::block_on
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/context/blocking.rs:66:14
  20: tokio::runtime::scheduler::multi_thread::MultiThread::block_on::{{closure}}
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/scheduler/multi_thread/mod.rs:87:22
  21: tokio::runtime::context::runtime::enter_runtime
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/context/runtime.rs:65:16
  22: tokio::runtime::scheduler::multi_thread::MultiThread::block_on
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/scheduler/multi_thread/mod.rs:86:9
  23: tokio::runtime::runtime::Runtime::block_on_inner
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/runtime.rs:358:50
  24: tokio::runtime::runtime::Runtime::block_on
             at /home/tyler/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/tokio-1.47.1/src/runtime/runtime.rs:330:18
  25: launch::main
             at ./launch.rs:34:7
  26: core::ops::function::FnOnce::call_once
             at /rustc/69b76df90c7ea63b5350d1865f92902a0b27c9a2/library/core/src/ops/function.rs:253:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

More details:

Something about this code seems to be passing in either too much or too weird of data to arrow's concat_batches, it's not clear to me however whether this is a bug on our side or something a little goofy about concat_batches. It manifests in this version of deltalake-core because this version is where we start to perform this kernal'd log replay that invokes concat_batches

Metadata

Metadata

Assignees

Labels

binding/rustIssues for the Rust cratebugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions