dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

Dragonfly crashes after loading from snapshot

Open BagritsevichStepan opened this issue 1 year ago • 3 comments

Dragonfly crashes after loading from snapshot

To Reproduce Run dragonfly:

$ ./dragonfly --alsologtostderr
I20240828 16:11:24.083609 234360 init.cc:80] ./dragonfly running in debug mode.
* Logs will be written to the first available of the following paths:
/tmp/dragonfly.*
./dragonfly.*
* For the available flags type dragonfly [--help | --helpfull]
* Documentation can be found at: https://www.dragonflydb.io/docs
I20240828 16:11:24.084056 234360 dfly_main.cc:640] Starting dragonfly df-dev-0000000
I20240828 16:11:24.084182 234360 dfly_main.cc:684] maxmemory has not been specified. Deciding myself....
I20240828 16:11:24.084190 234360 dfly_main.cc:693] Found 18.81GiB available memory. Setting maxmemory to 15.04GiB
I20240828 16:11:24.090487 234361 uring_proactor.cc:180] IORing with 1024 entries, allocated 98368 bytes, cq_entries is 2048
I20240828 16:11:24.165813 234360 proactor_pool.cc:147] Running 16 io threads
I20240828 16:11:24.175113 234360 server_family.cc:783] Host OS: Linux 6.8.0-40-generic x86_64 with 16 threads
I20240828 16:11:24.175599 234360 snapshot_storage.cc:112] Load snapshot: Searching for snapshot in directory: "/home/bagrstepan/Documents/GitHub/orig_dragonfly/dragonfly/build-dbg"
I20240828 16:11:24.176240 234360 server_family.cc:997] Loading /home/bagrstepan/Documents/GitHub/orig_dragonfly/dragonfly/build-dbg/dump-2024-08-28T16:00:52-summary.dfs
I20240828 16:11:24.177734 234362 listener_interface.cc:101] sock[36] AcceptServer - listening on port 6379
I20240828 16:11:24.177752 234365 server_family.cc:1050] Load finished, num keys read: 3
F20240828 16:11:33.483773 234363 doc_index.cc:130] Check failed: ids_.count(key) == 0u (1 vs. 0) 
*** Check failure stack trace: ***
    @     0x644521624a7d  google::LogMessage::Fail()
    @     0x6445216249c3  google::LogMessage::SendToLog()
    @     0x644521624176  google::LogMessage::Flush()
    @     0x64452162826e  google::LogMessageFatal::~LogMessageFatal()
    @     0x644520c0d7f4  dfly::ShardDocIndex::DocKeyIndex::Add()
    @     0x644520c0e446  dfly::ShardDocIndex::AddDoc()
    @     0x644520c0ff26  dfly::ShardDocIndices::AddDoc()
    @     0x644520847d9f  dfly::(anonymous namespace)::OpSet()
  1. redis-cli (first run):
127.0.0.1:6379> hset d:1 number 1.0
(integer) 1
127.0.0.1:6379> hset d:2 number 2.0
(integer) 1
127.0.0.1:6379> hset d:3 number 3.0
(integer) 1
127.0.0.1:6379> ft.create i1 on hash schema number tag
OK
127.0.0.1:6379> ft.search i1 "@number:{2.0}"
1) (integer) 0
127.0.0.1:6379> quit
  1. restart dragonfly with loading from snapshot

  2. redis-cli (second run):

127.0.0.1:6379> flushall
OK
127.0.0.1:6379> hset d:2 number 2.0
Error: Server closed the connection

BagritsevichStepan avatar Aug 28 '24 14:08 BagritsevichStepan

yes, reproduces, with even shorter:

hset d:1 number 1.0
ft.create i1 on hash schema number tag
flushall
hset d:1 number 1.0

romange avatar Aug 28 '24 14:08 romange

@romange may be it will be fixed with the #3539

But I'm not sure yet.

BagritsevichStepan avatar Aug 28 '24 14:08 BagritsevichStepan

Yes, it is fixed by #3539

BagritsevichStepan avatar Aug 28 '24 15:08 BagritsevichStepan