facebook / rocksdb

A library that provides an embeddable, persistent key-value store for fast storage.
http://rocksdb.org
GNU General Public License v2.0
28.59k stars 6.32k forks source link

LevelCompactionBuilder::SetupInitialFiles fail on assert #5747

Open TenderWang opened 5 years ago

TenderWang commented 5 years ago

I receive segfault in LevelCompactionBuilder::SetupInitialFiles about "assert(!level_and_file.second->being_compacted);" This is in version 5.13.0

(gdb) bt

0 0x00007f0854f4e0c1 in pthread_kill () from /lib/x86_64-linux-gnu/libpthread.so.0

1 0x00000000007a1d1d in handle_fatal_signal (sig=6) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/sql/signal_handler.cc:220

2

3 0x00007f0853d66067 in raise () from /lib/x86_64-linux-gnu/libc.so.6

4 0x00007f0853d67448 in abort () from /lib/x86_64-linux-gnu/libc.so.6

5 0x00007f0853d5f266 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

6 0x00007f0853d5f312 in __assert_fail () from /lib/x86_64-linux-gnu/libc.so.6

7 0x00007f083eef85f5 in SetupInitialFiles (this=) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/compaction_picker.cc:1188

8 PickCompaction (this=0x7f083bb8f860) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/compaction_picker.cc:1281

9 rocksdb::LevelCompactionPicker::PickCompaction (this=, cf_name=..., mutable_cf_options=..., vstorage=, log_buffer=)

at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/compaction_picker.cc:1480

10 0x00007f083eec5afc in rocksdb::ColumnFamilyData::PickCompaction (this=this@entry=0x10782600, mutable_options=..., log_buffer=log_buffer@entry=0x7f083bb90480)

at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/column_family.cc:918

11 0x00007f083ef28da2 in rocksdb::DBImpl::BackgroundCompaction (this=this@entry=0x375ed00, made_progress=made_progress@entry=0x7f083bb9014f, job_context=job_context@entry=0x7f083bb901a0, log_buffer=log_buffer@entry=0x7f083bb90480,

prepicked_compaction=prepicked_compaction@entry=0x0) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/db_impl_compaction_flush.cc:1646

12 0x00007f083ef2ab7a in rocksdb::DBImpl::BackgroundCallCompaction (this=this@entry=0x375ed00, prepicked_compaction=prepicked_compaction@entry=0x0, bg_thread_pri=bg_thread_pri@entry=rocksdb::Env::LOW)

at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/db_impl_compaction_flush.cc:1457

13 0x00007f083ef2b2ea in rocksdb::DBImpl::BGWorkCompaction (arg=) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/db/db_impl_compaction_flush.cc:1274

14 0x00007f083f116228 in operator() (this=0x7f083bb90e30) at /usr/include/c++/4.9/functional:2439

15 rocksdb::ThreadPoolImpl::Impl::BGThread (this=this@entry=0x6d90540, thread_id=thread_id@entry=5) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/util/threadpool_imp.cc:240

16 0x00007f083f11647f in rocksdb::ThreadPoolImpl::Impl::BGThreadWrapper (arg=0x34ca280) at /home/wanggang01/dbdir/innosql-v4b-0627/mysql-5.7.20/storage/rocksdb/rocksdb/util/threadpool_imp.cc:278

17 0x00007f08546a9990 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6

18 0x00007f0854f49064 in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0

19 0x00007f0853e1962d in clone () from /lib/x86_64-linux-gnu/libc.so.6

TenderWang commented 5 years ago

MariaDB has the same problem: https://jira.mariadb.org/browse/MDEV-16523

ChrisZMF commented 2 years ago

Hi. This bug also occurred in our project. Has it been fixed? @LoveTommy