Skip to content

Fix: Race condition between optimize and checkpoint causes infinity crash#3326

Open
zpf121 wants to merge 2 commits intoinfiniflow:mainfrom
zpf121:fix_issue_3325
Open

Fix: Race condition between optimize and checkpoint causes infinity crash#3326
zpf121 wants to merge 2 commits intoinfiniflow:mainfrom
zpf121:fix_issue_3325

Conversation

@zpf121
Copy link
Contributor

@zpf121 zpf121 commented Mar 19, 2026

Close #3325

Actual behavior and How to reproduce it

Description

Running optimize and checkpoint simultaneously can cause the database to crash with an UnrecoverableError.

Error Log

[20:44:24.615] [1856579] [critical] UnrecoverableError: Invalid buffer type: ToMmap
   0# infinity::PrintStacktrace at /home/weilongma/zpf/infinity/src/common/utility/exception_impl.cpp:47
   1# infinity::UnrecoverableError at /home/weilongma/zpf/infinity/src/common/utility/exception_impl.cpp:81
   2# infinity::BufferObj::ToMmap at /home/weilongma/zpf/infinity/src/storage/buffer/buffer_obj_impl.cpp:386
   3# infinity::NewTxn::TryToMmap at /home/weilongma/zpf/infinity/src/storage/new_txn/new_txn_data_impl.cpp:2142
   4# infinity::NewTxn::CheckpointTable at /home/weilongma/zpf/infinity/src/storage/new_txn/new_txn_data_impl.cpp:1396
   5# infinity::NewTxn::CheckpointDB at /home/weilongma/zpf/infinity/src/storage/new_txn/new_txn_impl.cpp:1889
   6# infinity::NewTxn::Checkpoint at /home/weilongma/zpf/infinity/src/storage/new_txn/new_txn_impl.cpp:1802
   7# infinity::NewCheckpointTask::ExecuteWithNewTxn at /home/weilongma/zpf/infinity/src/storage/bg_task/bg_task_impl.cpp:54
   8# infinity::BGTaskProcessor::Process at /home/weilongma/zpf/infinity/src/storage/bg_task/background_process_impl.cpp:93

Reproduce

In TestMultipleIndexTypesImport, set:
pytest.param("test/data/config/restart_test/test_insert/3.toml", MultiIndexTypesGenerator, 5, 10, 120, marks=pytest.mark.slow)

uv run python3 tools/run_restart_test.py --infinity_path=cmake-build-release/src/infinity --marker=slow --test_case=test_multiple_index_types_import.py 2>&1 | tee /tmp/123456.log

@zpf121 zpf121 marked this pull request as draft March 19, 2026 11:52
@zpf121 zpf121 added the slow-test To trigger slow test label Mar 19, 2026
@zpf121 zpf121 marked this pull request as ready for review March 19, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

slow-test To trigger slow test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Race condition between optimize and checkpoint causes infinity crash

1 participant