Ambiguous state of artifacts file after sending SIGINT to hived during its generation
I started hived with block_log
, but without block_log.artifacts
file.
Soon after it attempted to generate block artifact file I tried to stop it with Ctrl+C, surprisingly, it just continued as it was ok.
2022-08-06T15:07:02.882865 block_log_artifacts.cpp:289 try_to_open ] Could not find artifacts file in /storage1/hive/datadir-mirror/blockchain/block_log.artifacts, it will be
created and generated from block_log.
2022-08-06T15:07:02.882892 block_log_artifacts.cpp:419 generate_file ] Attempting to generate a block artifact file for block range: 1...66755355
2022-08-06T15:07:02.883604 block_log.cpp:704 for_each_block ] Walking over block log starting from block: 66755355...
2022-08-06T15:07:06.056110 block_log_artifacts.cpp:490 operator() ] Processed block 66000000
2022-08-06T15:07:09.796921 block_log_artifacts.cpp:485 operator() ] Processed block 65000000 at 267325.34 blocks/s, estimated 243s remaining
2022-08-06T15:07:18.928805 block_log_artifacts.cpp:485 operator() ] Processed block 64000000 at 109506.91 blocks/s, estimated 584s remaining
^C
2022-08-06T15:07:29.788700 application.cpp:93 handle_signal ] _last_signal_code: 2
2022-08-06T15:07:29.788739 application.cpp:84 generate_interrupt_r ] interrupt requested!
2022-08-06T15:07:29.788749 block_log.cpp:730 for_each_block ] Stopping block position list walk on caller request... Last processed block: 63122843
2022-08-06T15:07:30.916002 block_log.cpp:744 for_each_block ] Block log walk finished in time: 28 s.
2022-08-06T15:07:30.918743 block_log_artifacts.cpp:540 generate_file ] Block artifact file generation finished. 66755355 blocks processed in time: 28036 ms
You can't tell that something is wrong with artifacts because its size looks ok:
1602128568 Aug 6 15:07 block_log.artifacts
Except for the content, as this is a sparse file with allocated roughly 84MB instead of 1.5GB.
It was started with --load-snapshot, and after loading it - exited
(snapshot loaded correctly, it's different, isolated environment than described in #346 (closed) even though both are related to issues with Ctrl+C)
So after starting it back again it just continue to operate, despite artifacts file being empty. Improved consistency checks are needed #336 (closed)