Release Date: 2025-12-02 Type: Feature Release Previous Version: v1.3.6
Version 1.3.7 introduces asynchronous DUMP SAVE operations and the new DUMP STATUS command for improved operational usability. This release also includes critical bug fixes and logging standardization.
Highlights:
- Async DUMP SAVE - Non-blocking dump operations with immediate response
- DUMP STATUS command - Real-time progress monitoring for dump operations
- Critical SIGSEGV fix - VariableHandler ownership issue resolved
- Auto-dump/manual dump mutual exclusion - Prevents concurrent dump execution
Type: Feature
DUMP SAVE now executes asynchronously, returning immediately while the dump operation runs in the background.
Before: DUMP SAVE blocked until the entire dump operation completed, potentially taking minutes for large datasets.
After: DUMP SAVE returns immediately with OK DUMP_STARTED <filepath> and performs the dump in a background worker thread.
Key Changes:
- Background worker thread (
DumpSaveWorker) performs actual dump operation - Replication pausing/resuming handled within worker thread for proper async flow
- Synchronous fallback when dump_progress is unavailable (e.g., unit tests)
- Error messages suggest using DUMP STATUS for progress monitoring
Files Changed:
src/server/handlers/dump_handler.cpp- Async implementation with worker threadsrc/server/handlers/dump_handler.h- DumpSaveWorker declarationsrc/server/server_types.h- DumpProgress struct
Type: Feature
New command to query dump operation progress in real-time.
Syntax:
DUMP STATUS
Response Fields:
| Field | Description |
|---|---|
save_in_progress |
Whether a save operation is running |
load_in_progress |
Whether a load operation is running |
replication_paused_for_dump |
Whether replication was paused for the dump |
status |
Current status: IDLE, SAVING, LOADING, COMPLETED, FAILED |
filepath |
Path of the dump file being processed |
tables_processed |
Number of tables completed |
tables_total |
Total number of tables |
current_table |
Name of the table currently being processed |
elapsed_seconds |
Time elapsed since operation started |
result_filepath |
Final filepath on completion |
error |
Error message on failure |
Files Changed:
src/server/handlers/dump_handler.cpp- DUMP STATUS handlersrc/server/server_lifecycle_manager.cpp- DUMP_STATUS registrationsrc/query/query_parser.cpp- DUMP_STATUS query type
Type: Internal
Thread-safe progress tracking structure for dump operations.
Features:
- Mutex-protected state updates
DumpStatusenum: IDLE, SAVING, LOADING, COMPLETED, FAILED- Methods:
Reset(),UpdateTable(),Complete(),Fail(),JoinWorker() - Tracks start_time/end_time for elapsed time calculation
- Manages worker thread lifecycle
Files Changed:
src/server/server_types.h- DumpProgress struct and DumpStatus enum
Type: Critical Severity: Critical
Fix use-after-free crash in DocumentStore::RemoveDocument during concurrent delete operations.
Root Cause: The function stored a reference to the primary key string from the map, then erased the map entry (invalidating the reference), and finally used the dangling reference in the log statement. This bug existed since the initial commit but was exposed by Linux CI's memory allocator behavior during concurrent tests.
Symptom: Segmentation fault in DocumentStoreTest.ConcurrentDeletes test on Linux CI.
Solution:
- Copy the primary key string before erasing the map entry
- Add stress tests (
DocumentStoreStressTest) with SLOW label for regression detection
Files Changed:
src/storage/document_store.cpp- Copy string before erasetests/storage/document_store_stress_test.cpp- New stress test filetests/storage/CMakeLists.txt- Add stress test with SLOW label
Type: Critical Severity: Critical
Fix segmentation fault when executing SET or SHOW VARIABLES commands.
Root Cause: VariableHandler and RuntimeVariableManager ownership was not transferred from InitializedComponents to TcpServer. When InitializedComponents went out of scope, both objects were destroyed, leaving HandlerContext with a dangling pointer.
Solution:
- Add
variable_manager_andvariable_handler_members to TcpServer - Transfer ownership via
std::moveinTcpServer::Start() - Update HandlerContext to point to TcpServer-owned variable_manager
Files Changed:
src/server/tcp_server.h- Add member declarationssrc/server/tcp_server.cpp- Transfer ownership and update GetVariableManager()
Type: Bug Fix Severity: Medium
Implement proper synchronization between SnapshotScheduler (auto-dump) and manual DUMP SAVE operations to prevent concurrent dump execution.
Problem: Auto-dump and manual DUMP SAVE could execute concurrently, potentially causing data corruption.
Solution:
- Pass
dump_save_in_progressflag to SnapshotScheduler constructor - SnapshotScheduler checks and sets flag before taking automatic snapshots
- Auto-dump is skipped when manual DUMP SAVE is in progress
- Manual DUMP SAVE is blocked when auto-dump is running
Flag Renaming:
read_only_->dump_save_in_progress_loading_->dump_load_in_progress_GetLoadingFlag()->GetDumpLoadInProgressFlag()
Files Changed:
src/server/snapshot_scheduler.cpp- Flag check logicsrc/server/snapshot_scheduler.h- Constructor parametersrc/server/handlers/dump_handler.cpp- Updated flag names- Multiple test files - Updated flag names
Type: Bug Fix Severity: Low
GTID is now restored even when replication was not running before DUMP LOAD, enabling manual REPLICATION START after loading a dump file.
Files Changed:
src/server/handlers/dump_handler.cpp- GTID restoration logic
Type: Bug Fix Severity: Low
Fix BinlogReader::IsRunning() to check both running_ and should_stop_ flags. Also reset should_stop_ flag in Stop() for proper restart behavior.
Files Changed:
src/mysql/binlog_reader.cpp- IsRunning() and Stop() logic
Type: Refactoring
Standardize logging across the codebase by converting spdlog calls to StructuredLog API.
Changes:
- Convert all
spdlog::debug()toStructuredLog().Debug() - Convert
spdlog::error()in binlog_event_parser.cpp toStructuredLog().Error() - Add context fields: doc_id, text_length, ngrams counts, batch_size
- Add connection info: host, port for binlog_reader and server_ready
- Simplify verbose logs by removing redundant "reason" fields
- Update tests to check new log message format
Files Changed:
src/mysql/binlog_event_parser.cppsrc/mysql/binlog_reader.cppsrc/mysql/connection.cppsrc/mysql/rows_parser.cppsrc/index/index.cppsrc/index/posting_list.cppsrc/storage/document_store.cpp- And 20+ more files
Type: Refactoring
Introduce IBinlogReader interface for better testability.
Changes:
- Create
IBinlogReaderinterface with pure virtual methods BinlogReaderimplementsIBinlogReader- Handlers use
IBinlogReaderinstead of concrete class - Add deleted copy/move constructors and protected default constructor
- Add
finalkeyword andoverrideon destructor
Files Changed:
src/mysql/binlog_reader_interface.h- New interface filesrc/mysql/binlog_reader.h- Implement interfacesrc/server/handlers/*- Use interface type
Updated protocol documentation to reflect new async behavior:
- Document asynchronous execution behavior
- Add response format showing
OK DUMP_STARTEDmessage - Note to use DUMP STATUS for progress monitoring
Files Changed:
docs/en/protocol.mddocs/ja/protocol.md
Added complete documentation for the new command:
- Syntax and response format
- All response field descriptions
- Status value meanings
- Example responses
Files Changed:
docs/en/protocol.mddocs/ja/protocol.md
- 5 new DUMP STATUS tests (idle, save in progress, load in progress, replication paused, GTID preservation)
- GTID restoration test with MockBinlogReader
- Variable handler ownership test
- 2 new stress tests for RemoveDocument use-after-free regression (
DocumentStoreStressTest)
- Add
DumpHandlerGtidTestfixture with MockBinlogReader - Add
document_store_stress_test.cppwith SLOW label for CI exclusion - Update 10+ test files with new flag names
| Category | Files |
|---|---|
| Core Features | dump_handler.cpp/h, server_types.h, query_parser.cpp |
| Bug Fixes | document_store.cpp, tcp_server.cpp/h, snapshot_scheduler.cpp/h, binlog_reader.cpp |
| Refactoring | 25+ files (StructuredLog migration) |
| Interface | binlog_reader_interface.h |
| Documentation | docs/en/protocol.md, docs/ja/protocol.md |
| Tests | document_store_stress_test.cpp, dump_handler_test.cpp, variable_handler_test.cpp, 10+ updated |
Total: 68 files changed
- Stop MygramDB
- Upgrade to v1.3.7
- Restart MygramDB
Important: After upgrade, DUMP SAVE commands will behave asynchronously. Update any scripts that depend on synchronous DUMP SAVE completion to use DUMP STATUS for progress monitoring.
None.
No migration required. This is a backward-compatible release.
Behavioral Change: DUMP SAVE is now asynchronous. Scripts waiting for DUMP SAVE completion should be updated to poll DUMP STATUS instead.