- #1178 batches and transactions are now unified for subscribers.
- #1231
Tree::get_zero_copyallows for reading a value directly in-place without making anIVecfirst. - #1250 the global
print_profilefunction has been added which is enabled when compiling with themetricsfeature. - #1254
IVecdata will now always have an alignment of 8, which may enable interesting architecture-specific use cases. - #1307 & #1315
Db::contains_treecan be used to see if aTreewith a given name already exists.
- #1214 a new slab-style storage engine has been added which replaces the previous file-per-blob technique for storing large pages.
- #1231 tree nodes now get merged into a single-allocation representation that is able to dynamically avoid various overheads, resulting in significant efficiency improvements.
- #1400 Bump MSRV to 1.57.
- #1399 Thread support is now required on all platforms.
- #1135 The "no_metrics" anti-feature has been replaced with the "metrics" positive feature.
- #1178 the
Eventenum has become a unified struct that allows subscribers to iterate over each (Tree, key, optional value) involved in single key operations, batches, or transactions in a unified way. - #1178 the
Event::keymethod has been removed in favor of the new more comprehensiveitermethod. - #1214 The deprecated
Config::buildmethod has been removed. - #1248 The deprecated
Tree::setmethod has been removed. - #1248 The deprecated
Tree::delmethod has been removed. - #1250 The
Config::print_profile_on_dropmethod has been removed in favor of the globalprint_profilefunction. - #1252 The deprecated
Db::openmethod has been removed. - #1252 The deprecated
Config::segment_cleanup_skewmethod has been removed. - #1252 The deprecated
Config::segment_cleanup_thresholdmethod has been removed. - #1252 The deprecated
Config::snapshot_pathmethod has been removed. - #1253 The
IVec::subslicemethod has been removed. - #1275 Keys and values are now limited to 128gb on 64-bit platforms and 512mb on 32-bit platforms.
- #1281
Config'scache_capacityis now a usize, as u64 doesn't make sense for things that must fit in memory anyway. - #1314
Subscriber::next_timeoutnow requires a mutable self reference. - #1349 The "measure_allocs" feature has been removed.
- #1354
Errorhas been modified to be Copy, removing all heap-allocated variants.
- #1202 Fix a space leak where blobs were not removed when replaced by another blob.
- #1229 the powerful ALICE crash consistency tool has been used to discover several crash vulnerabilities, now fixed.
- #1314 Fix a bug in Subscriber's Future impl.
- documentation improved
- #1164 widen some trait bounds on trees and batches
- #1151
Sendis implemented forIter - #1167 added
Tree::firstandTree::lastfunctions to retrieve the first or last items in aTree, unless theTreeis empty.
- #1159 dropping a
Dbinstance will no-longer prematurely shut-down the background flusher thread. - #1168 fixed an issue that was causing panics during recovery in 32-bit code.
- #1170 when encountering corrupted storage data, the recovery process will panic less often.
- #1146 added
TransactionalTree::generate_id
- #1133 transactions and writebatch performance has been significantly improved by removing a bottleneck in the atomic batch stability tracking code.
- #1136 Added the
TransactionalTree::flushmethod to flush the underlying database after the transaction commits and before the transaction returns.
- #1132 implemented Fromsled::Error for io::Error to reduce friction in some situations.
- #1131 transactions performed on
Trees from differentDbs will now safely fail. - #1131 transactions may now only be performed on tuples of up to 14 elements. For higher numbers, please use slices.
- #1125 the backtrace crate has been made optional, which cuts several seconds off compilation time, but may cause breakage if you interacted with the backtrace field of corruption-related errors.
- #1128
Tree::pop_minandTree::pop_maxhad a bug where they were not atomic.
- #1116
IVec::subslicehas been added to facilitate creating zero-copy subslicedIVecs that are backed by the same data.
- #1120 Fixed a use-after-free caused by missing
refkeyword on aCopytype in a pattern match inIVec::as_mut. - #1108 conversions from
Box<[u8]>toIVecare fixed.
- #1079
Transactionalis now implemented for[&Tree]and[Tree]so you can avoid the previous friction of using tuples, as was necessary previously. - #1058 The minimum supported Rust version (MSRV) is now 1.39.0.
- #1037
Subscribernow implementsFuture(non-fused) so prefix watching may now be iterated over viawhile let Some(event) = (&mut subscriber).await {}
- #965 concurrency control is now dynamically enabled for atomic point operations, so that it may be avoided unless transactional functionality is being used in the system. This significantly increases performance for workloads that do not use transactions.
- A number of memory optimizations have been implemented.
- Disk usage has been significantly reduced for many workloads.
- #1016 On 64-bit systems, we can now store 1-2 trillion items.
- #993 Added DerefMut and AsMut<[u8]> for
IVecwhere it works similarly to aCow, making a private copy if the backingArc's strong count is not 1. - #1020 The sled wiki has been moved into the documentation
itself, and is accessible through the
docmodule exported in lib.
- #975 Changed the default
segment_sizefrom 8m to 512k. This will result in far smaller database files due to better file garbage collection granularity. - #975 deprecated several
Configoptions that will be removed over time. - #1000 rearranged some transaction-related imports, and
moved them to the
transactionmodule away from the library root to keep the top level docs clean. - #1015
TransactionalTree::apply_batchnow accepts its argument by reference instead of by value. Eventhas been changed to make the inner fields named instead of anonymous.- #1057 read-only mode has been removed due to not having the resources to properly keep it tested while making progress on high priority issues. This may be correctly implemented in the future if resources permit.
- The conversion between
Box<[u8]>andIVechas been temporarily removed. This is re-added in 0.32.1.
- #947 dramatic read and recovery optimizations
- #921 reduced the reliance on locks while performing multithreaded IO on windows.
- #928 use
sync_file_rangeon linux instead of a full fsync for most writes. - #946 io_uring support changed to the
riocrate - #939 reduced memory consumption during zstd decompression
- #927 use SQLite-style varints for serializing
u64. This dramatically reduces the written bytes for databases that store small keys and values. - #943 use varints for most of the fields in message headers, causing an additional large space reduction. combined with #927, these changes reduce bytes written by 68% for workloads writing small items.
- Documentation-only release
- Added the
openfunction for quickly opening a database at a path with default configuration.
- Fixed an issue where an idle threadpool worker would spin in a hot loop until work arrived
- Migrated to a new storage format
- Fixed a bug where cache was not being evicted.
- Fixed a bug with using transactions with compression.
- The
create_newoption has been added toConfig, allowing the user to specify that a database should only be freshly created, rather than re-opened.
- Fixed a bug where prefix encoding could be incorrectly handled when merging nodes together.
- The
Config::openmethod has been added to giveConfiga similar feel to std'sfs::OpenOptions. TheConfig::buildandDb::startmethods are now deprecated in favor of callingConfig::opendirectly. - A
checksummethod has been added to Tree and Db for use in verifying backups and migrations. - Transactions may now involve up to 69 different tables. Nice.
- The
TransactionError::Abortvariant has had a generic member added that can be returned as a way to return information from a manually-aborted transaction. Anaborthelper function has been added to reduce the boiler- plate required to return aborted results.
- The
ConfigBuilderstructure has been removed in favor of a simplifiedConfigstructure with the same functionality. - The way that sled versions are detected at initialization time is now independent of serde.
- The
casmethod is deprecated in favor of the newcompare_and_swapmethod which now returns the proposed value that failed to be applied. - Tree nodes now have constant prefix encoding lengths.
- The
io_buf_sizeconfigurable renamed tosegment_size. - The
io_buf_sizeconfigurable method has been removed from ConfigBuilder. This can be manually set by setting the attribute directly on the ConfigBuilder, but this is discouraged. Additionally, this must now be a power of 2. - The
page_consolidation_thresholdmethod has been removed from ConfigBuilder, and this is now a constant of 10.
Iterno longer has a lifetime parameter.Db::open_treenow returns aTreeinstead of anArc<Tree>.Treenow has an inner type that uses anArc, so you don't need to think about it.
- A bug with prefix encoding has been fixed that led to nodes with keys longer than 256 bytes being stored incorrectly, which led to them being inaccessible and also leading to infinite loops during iteration.
- Several cases of incorrect unsafe code were removed from the sled crate. No bugs are known to have been encountered, but they may have resulted in incorrect optimizations in future refactors.
Event::Sethas been renamed toEvent::InsertandEvent::Delhas been renamed toEvent::Remove. These names better align with the methods of BTreeMap from the standard library.
- A deadlock was possible in very high write volume situations when the segment accountant lock was taken by all IO threads while a task was blocked trying to submit a file truncation request to the threadpool while holding the segment accountant lock.
flush_asynchas been added to perform time-intensive flushing in an asynchronous manner, returning a Future.
- std::thread is no longer used on platforms other than linux, macos, and windows, which increases portability.
- Transactions! You may now call
Tree::transactionand perform reads, writes, and deletes within a provided closure with aTransactionalTreeargument. This closure may be called multiple times if the transaction encounters a concurrent update in the process of its execution. Transactions may also be used on tuples ofTreeobjects, where the closure will then be parameterized onTransactionalTreeinstances providing access to each of the providedTreeinstances. This allows you to atomically read and modify multipleTreeinstances in a single atomic operation. These transactions are serializable, fully ACID, and optimistic. Tree::apply_batchallows you to apply aBatchTransactionalTree::apply_batchallow you to apply aBatchfrom within a transaction.
Tree::batchhas been removed. Now you can directly create aBatchwithBatch::default()and then apply it to aTreewithTree::apply_batchor during a transaction usingTransactionalTree::apply_batch. This facilitates multi-Treebatches via transactions.Event::Mergehas been removed, andTree::mergewill now send a completeEvent::Setitem to be distributed to all listening subscribers.