Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 0.19.0 #669

Merged
merged 2 commits into from Aug 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
34 changes: 32 additions & 2 deletions CHANGELOG.md
Expand Up @@ -2,9 +2,39 @@

## [Unreleased]

## 0.19.0 (2022-08-05)

* Add support for building with `io_uring` on Linux (parazyd)
* Change iterators to return Result (mina86)
* Support RocksDB transaction (yiyuanliu)
* Avoid pulling in dependencies via static feature flag (niklasf)
* Bump `rocksdb` to 7.4.4 (niklasf)
* Bump `tikv-jemalloc-sys` to 0.5 (niklasf)
* Update `set_use_fsync` comment (nazar-pc)
* Introduce ReadOptions::set_iterate_range and PrefixRange (mina86)
* Bump `rocksdb` to 7.4.3 (aleksuss)
* Don’t hold onto ReadOptions.inner when iterating (mina86)
* Bump `zstd-sys` from 1.6 to 2.0 (slightknack)
* Enable a building on the iOS platform (dignifiedquire)
* Add DBRawIteratorWithThreadMode::item method (mina86)
* Use NonNull in DBRawIteratorWithThreadMode (mina86)
* Tiny refactoring including fix for UB (niklasf)
* Add batched version MultiGet API (yhchiang-sol)
* Upgrade to rocksdb v7.3.1 (yhchiang-sol)
* Consistently use `ffi_util::to_cpath` to convert `Path` to `CString` (mina86)
* Convert properties to `&CStr` (mina86)
* Allow passing `&CStr` arguments (mina86)
* Fix memory leak when reading properties and avoid memory allocation (mina86)
* Fix Windows UTF-8 build flag (rajivshah3)
* Use more target features to build librocksdb-sys (niklasf)
* Fix `bz_internal_error` symbol multiply defined (nanpuyue)
* Bump rocksdb to 7.1.2 (dignifiedquire)
* Add BlobDB options (dignifiedquire)
* Add snapshot `PinnableSlice` based API (zheland)

## 0.18.0 (2022-02-03)

* Add open_cf_descriptor methods for Seoncdary and ReadOnly AccessType (steviez)
* Add open_cf_descriptor methods for Secondary and ReadOnly AccessType (steviez)
* Make Ribbon filters available (niklasf)
* Change versioning scheme of `librocksdb-sys` crate (aleksuss)
* Upgrade to RocksDB 6.28.2 (akrylysov)
Expand All @@ -30,7 +60,7 @@
* Support UTF-8 file paths on Windows (rajivshah3)
* Support building RocksDB with jemalloc (akrylysov)
* Add rocksdb WAL flush api (duarten)
* Update rocksdb to v6.22.1 (#540)
* Update rocksdb to v6.22.1 (duarten)

## 0.17.0 (2021-07-22)

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "rocksdb"
description = "Rust wrapper for Facebook's RocksDB embeddable database"
version = "0.18.0"
version = "0.19.0"
edition = "2018"
authors = ["Tyler Neely <t@jujit.su>", "David Greenberg <dsg123456789@gmail.com>"]
repository = "https://github.com/rust-rocksdb/rust-rocksdb"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -5,6 +5,7 @@ rust-rocksdb
[![documentation](https://docs.rs/rocksdb/badge.svg)](https://docs.rs/rocksdb)
[![license](https://img.shields.io/crates/l/rocksdb.svg)](https://github.com/rust-rocksdb/rust-rocksdb/blob/master/LICENSE)
[![Gitter chat](https://badges.gitter.im/rust-rocksdb/gitter.png)](https://gitter.im/rust-rocksdb/lobby)
![rust 1.60.0 required](https://img.shields.io/badge/rust-1.60.0-blue.svg?label=MSRV)


![GitHub commits (since latest release)](https://img.shields.io/github/commits-since/rust-rocksdb/rust-rocksdb/latest.svg)
Expand Down Expand Up @@ -42,7 +43,7 @@ default-features = false
features = ["lz4"]
```

## Multi-threaded ColumnFamily alternation
## Multithreaded ColumnFamily alternation

The underlying RocksDB does allow column families to be created and dropped
from multiple threads concurrently. But this crate doesn't allow it by default
Expand Down
13 changes: 6 additions & 7 deletions src/transactions/options.rs
Expand Up @@ -14,7 +14,6 @@
//

use crate::ffi;
use core::panic;

pub struct TransactionOptions {
pub(crate) inner: *mut ffi::rocksdb_transaction_options_t,
Expand Down Expand Up @@ -51,7 +50,7 @@ impl TransactionOptions {
///
/// If a transaction has a snapshot set, the transaction will ensure that
/// any keys successfully written(or fetched via `get_for_update`) have not
/// been modified outside of this transaction since the time the snapshot was
/// been modified outside this transaction since the time the snapshot was
/// set.
/// If a snapshot has not been set, the transaction guarantees that keys have
/// not been modified since the time each key was first written (or fetched via
Expand Down Expand Up @@ -149,7 +148,7 @@ impl Default for TransactionDBOptions {
let txn_db_opts = unsafe { ffi::rocksdb_transactiondb_options_create() };
assert!(
!txn_db_opts.is_null(),
"Could not create RocksDB transactiondb options"
"Could not create RocksDB transaction_db options"
);
Self { inner: txn_db_opts }
}
Expand All @@ -161,7 +160,7 @@ impl TransactionDBOptions {
}

/// Specifies the wait timeout in milliseconds when writing a key
/// outside of a transaction (ie. by calling `TransactionDB::put` directly).
/// outside a transaction (i.e. by calling `TransactionDB::put` directly).
///
/// If 0, no waiting is done if a lock cannot instantly be acquired.
/// If negative, there is no timeout and will block indefinitely when acquiring
Expand All @@ -183,8 +182,8 @@ impl TransactionDBOptions {
}
}

/// Specifies the default wait timeout in milliseconds when a stransaction
/// attempts to lock a key if not secified in `TransactionOptions`.
/// Specifies the default wait timeout in milliseconds when a transaction
/// attempts to lock a key if not specified in `TransactionOptions`.
///
/// If 0, no waiting is done if a lock cannot instantly be acquired.
/// If negative, there is no timeout. Not using a timeout is not recommended
Expand Down Expand Up @@ -266,7 +265,7 @@ impl OptimisticTransactionOptions {
///
/// If a transaction has a snapshot set, the transaction will ensure that
/// any keys successfully written(or fetched via `get_for_update`) have not
/// been modified outside of this transaction since the time the snapshot was
/// been modified outside the transaction since the time the snapshot was
/// set.
/// If a snapshot has not been set, the transaction guarantees that keys have
/// not been modified since the time each key was first written (or fetched via
Expand Down
32 changes: 19 additions & 13 deletions tests/test_optimistic_transaction_db.rs
Expand Up @@ -269,13 +269,13 @@ fn iterator_test() {
];

let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test that it's idempotent
let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);
let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test in reverse
let iter = db.iterator(IteratorMode::End);
Expand All @@ -290,13 +290,16 @@ fn iterator_test() {
(k3.clone(), v3.clone()),
(k4.clone(), v4.clone()),
];
assert_eq!(old_iter.collect::<Vec<_>>(), expected);
assert_eq!(old_iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected2);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected2);

let iter = db.iterator(IteratorMode::From(b"k3", Direction::Forward));
assert_eq!(iter.collect::<Vec<_>>(), vec![(k3, v3), (k4, v4)]);
assert_eq!(
iter.map(Result::unwrap).collect::<Vec<_>>(),
vec![(k3, v3), (k4, v4)]
);
}
}

Expand Down Expand Up @@ -344,7 +347,7 @@ fn prefix_extract_and_iterate_test() {
.into_iter()
.map(|(k, v)| (k.to_vec().into_boxed_slice(), v.to_vec().into_boxed_slice()))
.collect();
assert_eq!(expected, iter.collect::<Vec<_>>());
assert_eq!(expected, iter.map(Result::unwrap).collect::<Vec<_>>());
}
}

Expand Down Expand Up @@ -448,13 +451,13 @@ fn transaction_iterator() {
let txn = db.transaction();

let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test that it's idempotent
let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);
let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test in reverse
let iter = txn.iterator(IteratorMode::End);
Expand All @@ -469,13 +472,16 @@ fn transaction_iterator() {
(k3.clone(), v3.clone()),
(k4.clone(), v4.clone()),
];
assert_eq!(old_iter.collect::<Vec<_>>(), expected);
assert_eq!(old_iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected2);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected2);

let iter = txn.iterator(IteratorMode::From(b"k3", Direction::Forward));
assert_eq!(iter.collect::<Vec<_>>(), vec![(k3, v3), (k4, v4)]);
assert_eq!(
iter.map(Result::unwrap).collect::<Vec<_>>(),
vec![(k3, v3), (k4, v4)]
);
}
}

Expand Down
36 changes: 21 additions & 15 deletions tests/test_transaction_db.rs
Expand Up @@ -296,17 +296,17 @@ fn iterator_test() {
];

let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test that it's idempotent
let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);
let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test in reverse
let iter = db.iterator(IteratorMode::End);
let mut tmp_vec = iter.collect::<Vec<_>>();
let mut tmp_vec = iter.map(Result::unwrap).collect::<Vec<_>>();
tmp_vec.reverse();

let old_iter = db.iterator(IteratorMode::Start);
Expand All @@ -317,13 +317,16 @@ fn iterator_test() {
(k3.clone(), v3.clone()),
(k4.clone(), v4.clone()),
];
assert_eq!(old_iter.collect::<Vec<_>>(), expected);
assert_eq!(old_iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

let iter = db.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected2);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected2);

let iter = db.iterator(IteratorMode::From(b"k3", Direction::Forward));
assert_eq!(iter.collect::<Vec<_>>(), vec![(k3, v3), (k4, v4)]);
assert_eq!(
iter.map(Result::unwrap).collect::<Vec<_>>(),
vec![(k3, v3), (k4, v4)]
);
}
}

Expand Down Expand Up @@ -372,7 +375,7 @@ fn prefix_extract_and_iterate_test() {
.into_iter()
.map(|(k, v)| (k.to_vec().into_boxed_slice(), v.to_vec().into_boxed_slice()))
.collect();
assert_eq!(expected, iter.collect::<Vec<_>>());
assert_eq!(expected, iter.map(Result::unwrap).collect::<Vec<_>>());
}
}

Expand Down Expand Up @@ -469,17 +472,17 @@ fn transaction_iterator() {
let txn = db.transaction();

let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test that it's idempotent
let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);
let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

// Test in reverse
let iter = txn.iterator(IteratorMode::End);
let mut tmp_vec = iter.collect::<Vec<_>>();
let mut tmp_vec = iter.map(Result::unwrap).collect::<Vec<_>>();
tmp_vec.reverse();

let old_iter = txn.iterator(IteratorMode::Start);
Expand All @@ -490,13 +493,16 @@ fn transaction_iterator() {
(k3.clone(), v3.clone()),
(k4.clone(), v4.clone()),
];
assert_eq!(old_iter.collect::<Vec<_>>(), expected);
assert_eq!(old_iter.map(Result::unwrap).collect::<Vec<_>>(), expected);

let iter = txn.iterator(IteratorMode::Start);
assert_eq!(iter.collect::<Vec<_>>(), expected2);
assert_eq!(iter.map(Result::unwrap).collect::<Vec<_>>(), expected2);

let iter = txn.iterator(IteratorMode::From(b"k3", Direction::Forward));
assert_eq!(iter.collect::<Vec<_>>(), vec![(k3, v3), (k4, v4)]);
assert_eq!(
iter.map(Result::unwrap).collect::<Vec<_>>(),
vec![(k3, v3), (k4, v4)]
);
}
}

Expand Down