Closed skyzh closed 1 year ago
What's more, if we run import for the third time...
stack backtrace:
0: rust_begin_unwind
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panicking.rs:577:5
1: core::panicking::panic_fmt
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/core/src/panicking.rs:110:14
2: core::result::unwrap_failed
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/core/src/result.rs:1737:5
3: risinglight::executor::copy_from_file::CopyFromFileExecutor::read_file_blocking
4: tokio::loom::std::unsafe_cell::UnsafeCell<T>::with_mut
5: tokio::runtime::task::harness::Harness<T,S>::poll
6: tokio::runtime::blocking::pool::Inner::run
Error: execute error: storage error: IO error: Too many open files (os error 24)
Caused by:
0: storage error: IO error: Too many open files (os error 24)
1: IO error: Too many open files (os error 24)
2: IO error: Too many open files (os error 24)
3: Too many open files (os error 24)
Stack backtrace:
0: std::backtrace_rs::backtrace::libunwind::trace
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
1: std::backtrace_rs::backtrace::trace_unsynchronized
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: std::backtrace::Backtrace::create
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/backtrace.rs:328:13
3: anyhow::error::<impl core::convert::From<E> for anyhow::Error>::from
4: <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll
5: risinglight::main::{{closure}}
6: tokio::park::thread::CachedParkThread::block_on
7: tokio::runtime::thread_pool::ThreadPool::block_on
8: risinglight::main
9: std::sys_common::backtrace::__rust_begin_short_backtrace
10: std::rt::lang_start::{{closure}}
11: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/core/src/ops/function.rs:259:13
12: std::panicking::try::do_call
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panicking.rs:485:40
13: std::panicking::try
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panicking.rs:449:19
14: std::panic::catch_unwind
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panic.rs:136:14
15: std::rt::lang_start_internal::{{closure}}
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/rt.rs:128:48
16: std::panicking::try::do_call
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panicking.rs:485:40
17: std::panicking::try
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panicking.rs:449:19
18: std::panic::catch_unwind
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/panic.rs:136:14
19: std::rt::lang_start_internal
at /rustc/5e57faa78aa7661c6000204591558f6665f11abc/library/std/src/rt.rs:128:20
20: _main
Which absolutely should not happen -- macOS has 128 open file limit, but it isn't possible that we opened 128 files at this point.
What if the compactor/vacuum is iterating over rowsets? There will be ~200 files in the data dir after the first import and will be doubled after the second. It's possible to exceed the open file limit.
I think we should limit the files opend by compactor and vacuum.
Yes for sure... Also one RowSet has multiple columns, so maybe ~10 RowSets would exceed 128 limit.
Tried create.sql
and 2x import.sql
, but not meet this error, maybe this issue has been fixed?
Thanks for update! Let’s close this issue for now.
This will happen at the end of the second import operation.
I suspect we should wait for vacuum and compactor to complete before stopping the database instance. (aka. graceful stop)