Skip to content

4.3.0

Latest

Choose a tag to compare

@cberner cberner released this 15 Sep 03:46
· 35 commits to master since this release

New features

  • Add optional locking methods to StorageBackend. Backends may implement these methods to support
    locking. Custom backends that wrap FileBackend should delegate these methods to the FileBackend
    otherwise file locking functionality will be lost.
  • Add an optional Key::separator(), which returns a short byte string that separates two keys.
    &[u8], &str, String keys now store minimal prefixes. Option, array keys, and tuple keys
    also store optimized separators when their element type is variable length. Tables with these
    key types will use slightly less space, and lookups will be faster.
  • Add Key::min_encoded_key(), the encoding of a key type's smallest value. Implementing it is
    optional, and lets container types holding that key store shorter separators.
  • Add experimental support for multi-process read-write access to a single database file, behind
    the experimental-multiprocess feature flag.

Bug fixes

  • Fix a crash shortly after a commit being able to silently roll that commit back during
    recovery, if check_integrity() had previously repaired the database.
  • Fix ReadOnlyUntypedTable and ReadOnlyUntypedMultimapTable potentially returning incorrect results
    if the originating transaction is dropped.
  • Fix iterators silently omitting data when iteration continues after an error. An iterator
    that yielded Err(Corrupted) could yield the rest of the table on later calls, skipping the
    unreadable entries with no further error. Iterators and read-only cursors now keep returning
    an error after the first one; re-seeking a cursor resets it.
  • Fix restore_savepoint(), rename_table(), and delete_table() leaving the transaction
    committable after a storage error. Committing it could corrupt the database or silently lose
    a table. Such failures now poison the transaction: commit() returns an error instead of
    committing the half-applied state.
  • Fix pages being leaked permanently when a panic unwound through a live write transaction and
    was caught with catch_unwind. The leak survived closing and reopening the database and grew
    with every such panic; the pages are now reclaimed the next time the database is opened.
  • Fix a Windows-only hang: a write to the database file that reported writing zero bytes made
    the commit retry it forever. It now fails with a WriteZero I/O error.
  • Fix rename_table() and rename_multimap_table() returning TableExists when the new name
    is the same as the current one. Renaming a table to its own name now succeeds and leaves the
    table unchanged.
  • Fix persistent_savepoint() and delete_persistent_savepoint() making the transaction
    ineligible for further savepoints, so a second savepoint in the same transaction failed with
    InvalidSavepoint. Only opening, renaming, or deleting a data table, or restoring a
    savepoint, makes a transaction savepoint-ineligible now.