You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All notable changes to the **btree_store** project will be documented in this file.
4
+
5
+
## [0.1.1] - 2026-01-18
6
+
7
+
### Added
8
+
-**Atomic Multi-Bucket Transactions**: Introduced `exec_multi` API and `MultiTxn` handle. This allows performing multiple operations across different buckets in a single atomic transaction with only one disk sync, significantly improving batch performance.
9
+
-**Enhanced Data Validation**: Reinforced `Node::validate` with physical invariant checks.
10
+
-**Torn Write Detection**: Enhanced `MetaNode::validate` to identify and reject zeroed-out blocks caused by power failures during I/O.
11
+
-**8-Byte Memory Alignment**: Guaranteed alignment for zero-copy serialization via `AlignedPage`.
12
+
13
+
### Changed
14
+
-**Closure-based Transaction API**: Introduced `exec` and `view` methods.
15
+
-**Unified Reclamation**: Consolidated page release via `Store::free_pages`.
16
+
-**Log Management**: Switched to `.pending` log truncation (`set_len(0)`).
17
+
-**Auto-Refresh**: Implicit superblock sync at transaction start.
18
+
-**API Simplification**: Continued the transition to closure-based APIs across all internal and external logic.
19
+
-**Shared Transaction State**: Clones share `pending` containers within the same process.
20
+
21
+
### Fixed
22
+
-**Double-Write Protocol**: Refined the superblock update sequence to guarantee zero-leak and zero-corruption recovery by splitting the commit into two distinct disk-sync phases.
**btree_store** is a high-performance, persistent, embedded key-value storage engine written in Rust. It implements a robust Copy-On-Write (COW) B-Tree architecture to ensure data integrity, crash safety, and efficient concurrent access.
3
+
**btree_store** is a persistent, embedded key-value storage engine written in Rust. It implements a robust Copy-On-Write (COW) B-Tree architecture to ensure data integrity, crash safety, and efficient concurrent access.
4
4
5
5
## Features
6
6
7
7
***ACID Compliance:** Atomic commits using COW, Snapshot Isolation, and double-buffered meta pages.
8
-
***Conflict Detection:** Built-in "First-Committer-Wins" strategy ensures data integrity in multi-process environments.
9
-
***Crash Safety:** A dedicated `.pending` log recovery mechanism reclaims leaked pages from interrupted transactions.
10
-
***Buckets:** Logical namespaces for data separation within a single database file.
The engine is optimized for high-throughput scenarios:
63
-
***Snapshot Isolation (SI)** allows concurrent readers and writers to operate without blocking each other.
64
-
***Bucket Handle Caching** ensures all threads share the same metadata locks, preventing structural corruption.
65
-
***Cursor-based path traversal** avoids redundant tree searches.
66
-
***RAII CommitContext** ensures zero-leak automatic rollbacks on failure.
67
-
***Transmute-based lifetime extension** in iterators allows returning direct references to internal buffers under a read lock.
76
+
***8-Byte Alignment:** Every page is allocated with 8-byte alignment, allowing direct casting of raw bytes to internal structures without memory copies.
77
+
***Snapshot Isolation (SI):** Readers and writers operate on stable snapshots without blocking each other (non-blocking reads).
78
+
***Automatic Page Reclamation:** Failed or conflicted transactions automatically trigger page reclamation to prevent database bloat.
79
+
***Transmute-based lifetime extension:** Iterators return direct references to internal buffers under a read lock, achieving near-zero allocation.
68
80
69
81
## Testing
70
82
71
83
The project includes a comprehensive suite of integration tests:
72
84
*`smo_stress_test`: Structural Modification Operations under heavy load.
73
85
*`crash_safety_tests`: Verifies data integrity across simulated crashes.
74
-
*`concurrency_tests`: Parallel readers and writers.
86
+
*`concurrency_tests`: Parallel readers and writers with auto-refresh validation.
75
87
*`leak_safety_tests`: Ensures no pages are lost during failed operations.
76
88
77
89
Run tests with:
@@ -81,4 +93,4 @@ cargo test
81
93
82
94
## License
83
95
84
-
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
96
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
0 commit comments