wip: chore: Update to origin/zaidoon/10.10.1, latest RocksDB, fix a few bugs #5

Draft
gamesguru wants to merge 257 commits from gamesguru/rust-rocksdb-zaidoon1:master into rust-rocksdb-upstream-master

257 commits

Author SHA1 Message Date
fddf84d4b7
Merge remote-tracking branch 'origin/zaidoon/10.10.1' 2026-03-09 11:55:03 -04:00
zaidoon
70400a7bc3 upgrade RocksDB to 10.10.1 2026-02-03 02:58:42 -05:00
Evan Jones
7f80296b61 Options: Document enable_statistics: stats are shared (#1068)
Also link the related functions to each other.

Extend the test to validate that calling get_statistics returns None
when not enabled.
2026-02-03 02:29:18 -05:00
Luca Casonato
ab7692d897 Add sequence_number method to SnapshotWithThreadMode (#1067)
* Add sequence_number method to SnapshotWithThreadMode
2026-02-03 02:29:18 -05:00
zaidoon
4f973bf6d9 use thread-local ReadOptions in Transaction::multi_get
Avoid allocating a new ReadOptions on each multi_get call by reusing
the thread-local DEFAULT_READ_OPTS, consistent with multi_get_cf and
other Transaction methods that already use this pattern.
2026-01-20 10:16:52 -05:00
zaidoon
518ca0fd1d simplify MergeOperands::get_operand using pointer add() method
Replace manual usize pointer arithmetic with idiomatic Rust pointer
operations. The previous implementation cast pointers to usize, manually
calculated offsets using mem::size_of, and cast back to pointers. The new
implementation uses ptr.add(index) which is cleaner, more readable, and
lets the compiler handle pointer arithmetic correctly.
2026-01-20 10:16:52 -05:00
zaidoon
83aceef5fc remove bincode and serde dev-dependencies, implement manual serialization in merge operator test 2026-01-10 00:23:13 -05:00
zaidoon
073133aa49 add zero-copy C API support for get_into_buffer, batched_multi_get_cf_slice, and optimized iterator
Take advantage of the new zero-copy C API exposed in RocksDB PRs #13911 and #14036.
New APIs:
- `get_into_buffer` / `get_into_buffer_cf`: Read values directly into a
  caller-provided buffer with zero allocation when the buffer is large enough.
  Returns `GetIntoBufferResult` enum indicating Found/NotFound/BufferTooSmall.
- `batched_multi_get_cf_slice` / `batched_multi_get_cf_slice_opt`: Optimized
  batch lookup using `rocksdb_slice_t` array API directly, eliminating the
  overhead of converting keys from separate pointer+size arrays.
Performance improvements:
- Iterator `key()` and `value()` now use `rocksdb_iter_key_slice` and
  `rocksdb_iter_value_slice` which return slices by value, avoiding output
  parameter overhead.
- `batched_multi_get_cf_slice` creates one Vec<rocksdb_slice_t> instead of
  two separate vectors, improving cache locality.
Added comprehensive tests covering all new APIs including edge cases like
zero-length buffers, empty values, binary data, and empty databases.
2026-01-09 14:38:49 -05:00
zaidoon
5842575f6c Release 0.45.0 2026-01-07 01:40:55 -05:00
zaidoon
000ac1b854 add tests for raw_ptr feature and update crate name import 2026-01-06 22:13:21 -05:00
Evan Jones
4b9ba976d6 MemoryUsageBuilder: Prevent outliving the DBs/caches (#1061)
This type must not outlive the DBs and caches that are added to it,
otherwise the caller will access invalid memory and likely crash.
Use PhantomData to ensure it does not outlive its arguments. This is
technically a breaking API change, but anything that used this code
in this way was likely broken anyway.

Co-authored-by: Oleksandr Anyshchenko <aanischenko@gmail.com>
2026-01-06 22:13:21 -05:00
Jacek Szwec
28b9a68ded Proposal: Add feature-gated trait to expose raw C pointers (#1044)
* feat: add raw-ptr access via feature flag

Closes: #1033

* refactor: add unsafe to 'as_raw_ptr'

* doc: remove redundant comments
2026-01-06 22:13:21 -05:00
zaidoon
b170af149f ci: comprehensive workflow improvements
- Add concurrency control to cancel redundant workflow runs
- Add CARGO_TERM_COLOR=always for colored output in logs
- Fix duplicate workflow runs (only run on push to master, not all pushes)
- Standardize checkout with submodules: recursive
- Remove redundant rustup override and cargo generate-lockfile steps
- Update audit action from rustsec/audit-check@master to actions-rust-lang/audit@v1
- Switch from dtolnay/rust-toolchain + Swatinem/rust-cache to
  actions-rust-lang/setup-rust-toolchain (built-in caching, problem matchers)
- Split test and test-multi-threaded-cf into separate parallel jobs
  (fixes disk space issue, faster CI)
- Add save-if to only save cache on master branch (prevents PR cache pollution)
2026-01-06 06:09:32 -05:00
Evan Jones
c8a73edc96 DBCommon.get_column_family_metadata(_cf): Fix memory leak (#1062)
This function previously called
rocksdb_column_family_metadata_get_name, which returns a malloc-ed C
string, without freeing it. Fix this, and try to make this kind of
mistake less likely by renaming the helper functions. This way, the
caller needs to think about if the string must be freed or not. Most
of the existing uses are actually from_cstr_and_free.

* Rename from_cstr to from_cstr_without_free
* Add from_cstr_and_free, which always frees the C string.
* Change existing uses to call the correct variant.
2026-01-06 05:28:47 -05:00
Evan Jones
085c668a1c DB.create_cf: Fix memory leak on error (#1063)
When rocksdb_create_column_family returns an error, it also returns
a non-NULL pointer that needs to be freed. I have attempted to submit
a fix for this upstream to RocksDB [1]. Add a check to free it if it
returns a non-NULL pointer, which will work with older versions of
RocksDB.

I believe this is the last of my set of fixes for valgrind reported
memory leaks in the rust-rocksdb tests.

[1] https://github.com/facebook/rocksdb/pull/14214
2026-01-06 05:28:47 -05:00
Evan Jones
431a38c579 MemoryUsageBuilder.add_tx_db: free base db (fix leak) (#1060)
The result of rocksdb_transactiondb_get_base_db must be freed using
rocksdb_transactiondb_close_base_db after we are done with it. Add
a Vec<*mut ffi::rocksdb_t> to MemoryUsageBuilder to fix a leak.

Co-authored-by: Zaidoon Abd Al Hadi <43054535+zaidoon1@users.noreply.github.com>
2026-01-06 05:28:47 -05:00
zaidoon
017b58923c refactor: use convert_rocksdb_error in event_listener for consistency 2026-01-06 05:28:47 -05:00
Evan Jones
77799767ac DBOptions.get_options_from_string: Fix leak on error (#1059)
If the rocksdb_get_options_from_string failed, we had 2 leaks:

* We forgot to free the newly allocated new_options value created by
  rocksdb_options_create. To avoid this: immediately wrap the result
  in an Options struct, so it will get dropped on all code paths.
* We forgot to free the errptr RocksDB error message. Use ffi_try!
  to fix this, which is what we do everywhere else.

Additionally: into_c_string() will fail if the Rust string contains
NUL (0x00) bytes. Convert the .expect() into a result and add a test
for this case.

To make error conversions a bit clearer, rename error_message to
convert_rocksdb_error. Add a doc comment that it will free the
argument. Also change the function to return an Error, since it is
always used in that way. Also add a doc comment to ffi_try!.
2026-01-06 05:28:47 -05:00
Mario Rugiero
d1dadff0a7 feat: expose get_options_from_string (#1040) 2026-01-06 05:28:47 -05:00
Evan Jones
c3f87a6970 DBOptions.set_compaction_filter: fix memory leak (#1058) 2026-01-06 05:28:47 -05:00
Evan Jones
919f9ca8cf DBOptions.set_comparator(_ts): fix memory leak (#1057)
The result of rocksdb_comparator_create must be passed to
rocksdb_comparator_destroy to free it. Add it to OptionsMustOutliveDB
so it is reference counted. Add a test that this works when shared
between DBs.

This fixes a memory leak found by running the tests with valgrind.
2026-01-06 05:28:47 -05:00
luohewuyang
719110f764 chore: minor improvement for docs (#1056)
Signed-off-by: luohewuyang <luohewuyang@outlook.com>
2026-01-06 05:28:47 -05:00
zaidoon
0ca35352e3 remove set_options_from_string (incorrectly named and wrong implementation) 2026-01-06 05:28:47 -05:00
Zaidoon Abd Al Hadi
1fabc67aa8
upgrade RocksDB to 10.9.1 (#188) 2026-01-06 01:40:13 -05:00
Zaidoon Abd Al Hadi
9521bc4879
sync with upstream & upgrade to Rust edition 2024 and MSRV 1.89.0 (#187)
* ci: use actions/checkout@v5l (#1043)

* feat: allow user to set checkpoint log size for flush (#1055)

* upgrade to Rust edition 2024 and MSRV 1.89.0

---------

Co-authored-by: Coder <161350311+MamunC0der@users.noreply.github.com>
Co-authored-by: QuantumExplorer <quantum@dash.org>
2025-12-29 13:24:47 -05:00
Evan Jones
b0c9d78772 Cache::new_hyper_clock_cache: Copy rustdocs from RocksDB (#1047)
Update the rustdoc on new_hyper_clock_cache to copy from RocksDB's
HyperClockCacheOptions in cache.h:
https://github.com/facebook/rocksdb/blob/main/include/rocksdb/cache.h

As of RocksDB 10.7: "HyperClockCache with no estimated_entry_charge
is now production-ready and is the preferred block cache
implementation vs. LRUCache"

https://github.com/facebook/rocksdb/blob/main/HISTORY.md#1070-09192025
2025-12-29 04:50:53 -05:00
vastonus
3f47b69120 chore: remove extra spaces in the comment (#1045) 2025-12-29 04:48:31 -05:00
Galoretka
0f07826e7b fix: correct ASCII comment to UTF-8 for consistency (#1036) 2025-12-29 04:48:09 -05:00
Zaidoon Abd Al Hadi
26c78a097b
fix 0.44.2 changelog (#186) 2025-11-05 20:56:11 -05:00
Zaidoon Abd Al Hadi
72b25ca5e1
Release 0.44.2 (#185) 2025-11-05 20:52:22 -05:00
Zaidoon Abd Al Hadi
7c51daebc5
add zero-copy MultiGet and prefix existence APIs and various other optimizations (#184) 2025-11-05 16:42:39 -05:00
Zaidoon Abd Al Hadi
ffd730d461
Update CHANGELOG.md 2025-10-24 05:34:14 -04:00
Pavel Tcholakov
4cc9a2c4b2
Expose APIs to import and export Column Families (#178)
* Expose APIs to import and export Column Families

Adds Checkpoint::export_column_family and
DB::create_column_family_with_import methods exposing the ability to
export and import checkpoints of column families.
2025-10-24 05:28:57 -04:00
zaidoon
48387e7e89 bump version to 0.44.1 and update changelog 2025-10-23 03:38:41 -04:00
zaidoon
eb4bac9c74 simplify SstFileManager by using default Env internally 2025-10-23 03:35:51 -04:00
zaidoon
43b629604d Release 0.44.0 2025-10-23 02:12:53 -04:00
Jacek Szwec
2b1096a5d1 feat: expose {enable,disable}_file_deletions (#1035)
* feat: expose {enable,disable}_file_deletions

Closes #1034
2025-10-23 01:59:09 -04:00
zaidoon
be79f9f4b2 add SST file manager support & compact on deletion collector factory with min file size 2025-10-22 22:09:40 -04:00
zaidoon
56694169fd upgrade RocksDB to 10.7.5 2025-10-22 20:43:16 -04:00
zaidoon
b8a0ebd2fa update various db options description and expose set_cache_index_and_filter_blocks_with_high_priority 2025-09-17 01:20:35 -04:00
zaidoon
19a34dc72a add dedicated test jobs for jemalloc and AddressSanitizer builds 2025-09-10 00:27:30 -04:00
zaidoon
ccb2945582 remove redundant as_ref() calls in database operations by leveraging generic type bounds 2025-09-09 20:14:22 -04:00
Evan Jones
4b50adbedd Options.set_callback_logger: Make closure lifetimes safe
The previous version allows calling a closure even after it gets
dropped, which causes "safe" Rust code to do illegal memory accesses.
To fix it: Store the log closure in an Arc to reference count it.
This ensures that even if an Options is cloned and used with
different DBs it will work.

Unfortunately this is a breaking API change. I think this is worth it
since the previous version can lead to invalid memory accesses.

Add a test that demonstrates the incorrect behavior.

Example that causes invalid memory accesses:

    let mut rdb_opts = rust_rocksdb::Options::default();
    rdb_opts.create_if_missing(true);
    {
        let obj_is_dropped = ExampleObject { arg: 42 };
        rdb_opts.set_callback_logger(
            rust_rocksdb::LogLevel::Debug,
            &|level: rust_rocksdb::LogLevel, msg: &str| {
                println!("arg={} level={level:?} msg={msg}", obj_is_dropped.arg);
            },
        );
    }
    rust_rocksdb::DB::open(&rdb_opts, "test_db")

Output showing that arg changes:

arg=42 level=Info msg=DB pointer 0x15b80b400
arg=-2999674700805604355 level=Info msg=[db/db_impl/db_impl.cc:1117] ------- DUMPING STATS -------
2025-09-04 17:46:41 -04:00
zaidoon
443fb623ce add support for SingleDelete 2025-08-30 09:12:33 -04:00
61d9d23872
disable default features for zstd 2025-08-27 15:32:33 +01:00
7345d844a1
Use continuwuity forks 2025-08-27 15:32:33 +01:00
June Clementine Strawberry
97da4d1475
try this way of setting numa
Signed-off-by: June Clementine Strawberry <june@3.dog>
2025-08-27 15:23:08 +01:00
June Clementine Strawberry
cd4d9081b8
add support for building with NUMA
Signed-off-by: June Clementine Strawberry <june@3.dog>
2025-08-27 15:23:08 +01:00
strawberry
5f902f6ecf
remove gtest from build include
Signed-off-by: strawberry <strawberry@puppygock.gay>
2025-08-27 15:23:08 +01:00
7229ff5165
Tweak bindgen options now we're on a newer version
Co-authored-by: strawberry <june@girlboss.ceo>
2025-08-27 15:23:08 +01:00
zaidoon
768de47a4b auto-generate perf metrics enum from RocksDB source 2025-08-26 14:17:03 -04:00
zaidoon
30a18f06d2 docs: enhance README with comprehensive usage examples and feature documentation 2025-08-23 13:51:54 -04:00
Ivan Kalinin
db068c631f Revert #981 with a proper support for CXXSTDLIB (#1029) 2025-08-13 09:48:23 -04:00
zaidoon
e62b440dde Release 0.43.0 2025-08-11 15:18:39 -04:00
zaidoon
77b2954544 update event listener to expose flush reason and subcompaction reason 2025-08-11 15:07:09 -04:00
zaidoon
f26a291488 upgrade to RocksDB 10.5.1 2025-08-11 13:31:59 -04:00
zaidoon
9e10063e9e clippy fixes 2025-08-10 02:20:25 -04:00
Timothy Gu
a0f6cef308 Ensure jemalloc is linked in when the feature is enabled (#1026) 2025-08-10 02:20:25 -04:00
zaidoon
3bf47cf22d fix set_skip_prepare transaction option to call correct c api 2025-08-10 02:20:25 -04:00
Till Rohrmann
0187fd4e76 Expose get_pinned_from_batch_and_db for WriteBatchWithIndex 2025-08-07 04:09:50 -04:00
Till Rohrmann
4e83875ccf Expose WBWI through rust-rocksdb 2025-08-07 04:09:50 -04:00
Ahmed Farghal
5cbdcfe0e5 Access to open column families names 2025-08-07 04:09:50 -04:00
Ahmed Farghal
1eecef615b Pass write batch by reference 2025-08-07 04:09:50 -04:00
Ahmed Farghal
6a9a6aed1e Use parking_lot's RwLock 2025-08-07 04:09:50 -04:00
zaidoon
7f35bf8e71 minor code refactor to take out different complex options outside of db_options file 2025-08-02 01:09:53 -04:00
zaidoon
f80b6d36a5 feat: expose set_memtable_avg_op_scan_flush_trigger 2025-07-30 09:00:23 -04:00
Evan Jones
a904a64308 mark set_skip_checking_sst_file_sizes_on_db_open as deprecated (#1017)
RocksDB 10.5.0 has marked this option as deprecated. It will do
nothing. The rust-rocksdb crate is still using RocksDB 9.10.0, so
this deprecation notice is a bit premature. However, I assume we will
eventually upgrade, and this notice will then be correct.
2025-07-24 21:32:09 -04:00
Rivers
e511531f24 Implement WriteBatchIteratorCf trait and update related methods for compatibility (#1002) 2025-07-24 21:32:09 -04:00
ran-openai
df3a544a30 Add get_approximate_sizes (#998) 2025-07-24 21:32:09 -04:00
Chain-Fox
5449047b25 ffi_util.rs: improve opt_bytes_to_str to avoid potential use-after-free (#693) (#1003)
Co-authored-by: Burton Qin <bobbqq@163.com>
2025-07-24 21:32:09 -04:00
Evan Jones
51d40f085e db_options.rs: deprecate set_ignore_range_deletions (RocksDB 10.2.1) (#1000)
RocksDB 10.2.1 is marking this API as deprecated. The upstream
documentation has changed to state the following. Update rustdoc to
match, and mark with #[deprecated]. Currently rust-rocksdb is not
using this version of RocksDB, but presumably it will eventually, so
we might as well mark this as deprecated now.

Upstream RocksDB comment:

// DEPRECATED: This option might be removed in a future release.
// There should be no noticeable performance difference whether this option
// is turned on or off when a DB does not use DeleteRange().

https://github.com/facebook/rocksdb/blob/v10.2.1/include/rocksdb/options.h#L1837
2025-07-24 21:32:09 -04:00
zaidoon
5543f28ad8 prep work for upgrading to rust 2024
running cargo fix --edition for now and keeping
only the backwards compatible changes
2025-07-23 14:26:44 -04:00
zaidoon
e0fd6c4c77 Release 0.42.1 2025-07-15 10:06:45 -04:00
zaidoon
9f64810267 fix event listener implementation and add partial support for on_background_error 2025-07-15 05:02:06 -04:00
zaidoon
2a5fcf1fe5 Release 0.42.0 2025-07-14 15:33:30 -04:00
zaidoon
f61449b4fc add event listener support 2025-07-14 12:02:25 -04:00
zaidoon
691ed6db41 upgrade to RocksDB 10.4.2 2025-07-10 22:57:45 -04:00
zaidoon
e5ad368f16 bump deps and make clippy happy 2025-06-29 04:17:03 -04:00
Lucas Pape
f6692aacbc fix: gcc15 build support
stolen from https://github.com/rust-rocksdb/rust-rocksdb/pull/1007/commits/7d3889271a6de0afd51fbcfa95184958c9fa9761
2025-06-06 16:49:55 -04:00
Zaidoon Abd Al Hadi
f798f33c07 make clippy happy 2025-05-29 18:05:01 -04:00
Zaidoon Abd Al Hadi
323f813793 fix CI 2025-05-29 18:05:01 -04:00
Zaidoon Abd Al Hadi
5aaa1d6bc5 Release 0.41.0 2025-04-29 21:57:19 -04:00
Zaidoon Abd Al Hadi
251c941b24 feat: expose set_memtable_op_scan_flush_trigger 2025-04-29 19:25:27 -04:00
Zaidoon Abd Al Hadi
602949d91f upgrade to RocksDB 10.2.1 2025-04-29 18:01:09 -04:00
Evan Jones
94858fcb79 doc db_iterator.rs: Minor edits to rustdoc; more links
Edit the rustdoc for both DBRawIteratorWithThreadMode and
DBIteratorWithThreadMode to clarify what they do, and link to each
other.
2025-04-26 23:38:22 -04:00
Zaidoon Abd Al Hadi
053d0ace16 Release 0.40.0 2025-04-19 01:46:29 -04:00
Zaidoon Abd Al Hadi
b5520604e0 upgrade to RocksDB 10.1.3 2025-04-19 01:42:25 -04:00
Zaidoon Abd Al Hadi
4900ba5bc2 Release 0.39.0 2025-04-01 00:50:36 -04:00
Zaidoon Abd Al Hadi
32a64a501d bump snappy to 1.2.2 2025-04-01 00:45:58 -04:00
Zaidoon Abd Al Hadi
32b5d96cb9 upgrade to RocksDB 10.0.1 2025-04-01 00:19:49 -04:00
Zaidoon Abd Al Hadi
70f688cac7 Release 0.38.0 2025-03-30 23:56:02 -04:00
Zaidoon Abd Al Hadi
c94f1e4245 add test to confirm rocksdb version matches expectation 2025-03-30 23:49:25 -04:00
Zaidoon Abd Al Hadi
9508ce96b1 upgrade to RocksDB 9.11.2 2025-03-30 23:49:25 -04:00
Zaidoon Abd Al Hadi
2d9d1ccaf8 Release 0.37.0 2025-03-07 01:00:12 -05:00
Zaidoon Abd Al Hadi
f2089d4a2b bump msrv to 1.81.0 2025-03-06 23:11:48 -05:00
Zaidoon Abd Al Hadi
3fe183fcc1 upgrade to RocksDB 9.11.1 2025-03-06 21:55:02 -05:00
timvisee
42ed54a038 Add backup options and db options sync/fsync getters/setters 2025-03-06 20:57:08 -05:00
Zaidoon Abd Al Hadi
06545f3dff add ROCKSDB_AUXV_GETAUXVAL_PRESENT for supported Linux systems
This lets RocksDB know that getauxval is supported which is needed to enable hardware accelerated crc32c for ARM on Linux
2025-03-02 22:24:42 -05:00
Brenden Matthews
fd3c71631e Fix C++ linking (#981)
* Fix C++ linking

Hard-coding the C++ library linking is bad practice, and instead this
crate needs to follow the practices as described under
https://docs.rs/cc/1.2.14/cc/index.html#c-support.

Without doing so, this crate will not compile on when using libc++
instead of libstdc++.

This change will keep the existing behaviour, while allowing downstream
consumers of this crate to override the C++ library with the `CXXSTDLIB`
which is respected by the cc crate.
2025-02-21 23:26:08 -05:00
lucasvuillier
25fc4f13ff WriteBatch: add support for WriteBatch::put_log_data 2025-02-15 01:29:51 -05:00
Henry Jiang
86f74e8ff9 Support builds on AIX (#978) 2025-02-15 01:29:51 -05:00
kilavvy
93378add71 Update test_db.rs 2025-02-15 01:29:51 -05:00
kilavvy
e7fc2e3ab6 Update test_raw_iterator.rs 2025-02-15 01:29:51 -05:00
Elias Rad
b979355aa4 Update README.md 2025-02-15 01:29:51 -05:00
Elias Rad
ddcfa2ea8c Update CONTRIBUTING.md 2025-02-15 01:29:51 -05:00
Elias Rad
1adf410543 Update README.md 2025-02-15 01:29:51 -05:00
Zaidoon Abd Al Hadi
e2e3dc60fb Update CI to include an ARM target 2025-01-17 22:42:06 -05:00
Zaidoon Abd Al Hadi
c56bd9187d Release 0.36.0 2025-01-03 20:38:33 -05:00
Zaidoon Abd Al Hadi
524d0b1d3e upgrade to RocksDB 9.10.0 2025-01-03 17:50:30 -05:00
Vini murafa
64965b239c typo fix Update CHANGELOG.md 2025-01-03 17:25:26 -05:00
Niklas Fiekas
3318ab2014 Fix future clippy warnings 2025-01-03 17:25:26 -05:00
teenager-ETH
5da8d6b6e4 Fix some typos (#967) 2025-01-03 17:25:26 -05:00
Vladimir Petrzhikovskii
fe769ddf67 speed up ci 2024-12-27 00:29:58 -05:00
Romashka
da9aae66d1 typo-Update README.md 2024-12-27 00:29:58 -05:00
Vladimir
4ec48e8269 feat: allow to set per cf ttl (#963) 2024-12-27 00:29:58 -05:00
Zaidoon Abd Al Hadi
f7831c066e fix security audit CI for real 2024-12-19 21:15:44 -05:00
Zaidoon Abd Al Hadi
bc097eebbe security audit fix up 2024-12-19 15:32:00 -05:00
Zaidoon Abd Al Hadi
6e0ae79fbc fix security audit 2024-12-19 14:41:14 -05:00
crStiv
0313eea6ff chore: fix multiple typos of different importance (#959) 2024-12-19 14:41:14 -05:00
DeVikingMark
be3f43a2dc Fix some typos (#960) 2024-12-19 14:41:14 -05:00
Zaidoon Abd Al Hadi
130cf24126 Release 0.35.0 2024-12-17 15:36:26 -05:00
Jason Volk
83151a8498 add set_use_delta_encoding() to Options
Signed-off-by: Jason Volk <jason@zemos.net>
2024-12-17 15:24:00 -05:00
Zaidoon Abd Al Hadi
a7eb62d496 upgrade to RocksDB 9.9.3 2024-12-17 14:31:51 -05:00
Zaidoon Abd Al Hadi
f78352b2b2 minor README formatting 2024-12-14 17:07:12 -05:00
Evan Jones
357b09cacc Options: Add set_track_and_verify_wals_in_manifest (#954)
This was added to the C API in RocksDB 9.7.0. The RocksDB wiki
recommends setting this option to true:

"We recommend to set track_and_verify_wals_in_manifest to true for
production, it has been enabled in production for the entire database
cluster serving the social graph for all Meta apps."

See: https://github.com/facebook/rocksdb/wiki/Track-WAL-in-MANIFEST
2024-12-12 00:12:37 -05:00
Vladimir Petrzhikovskii
224b81dd34 Add lto feature 2024-12-12 00:12:37 -05:00
Evan Jones
823b96bf4f DB: Implement get_db_identity using rocksdb_get_db_identity
This exposes the rocksdb_get_db_identity function, which calls
DB::GetDbIdentity. It also adds a setter and accessor to Options to
change the option.

This function is useful to determine if two RocksDB copies originated
from the same place.
2024-12-12 00:12:37 -05:00
Zaidoon Abd Al Hadi
f22014c5f1 Release 0.34.0 2024-12-04 02:25:32 -05:00
Zaidoon Abd Al Hadi
9fd9a9f23e upgrade to RocksDB 9.8.4 2024-12-04 02:19:43 -05:00
popcnt
4f5f811e52 fix(build): add ROCKSDB_SCHED_GETCPU_PRESENT for Linux build config (#950)
* fix(build): add ROCKSDB_SCHED_GETCPU_PRESENT for Linux build config

This change adds a definition for ROCKSDB_SCHED_GETCPU_PRESENT in the Linux-specific section of the build script. This ensures that the RocksDB library is aware of the presence of the sched_getcpu function on Linux systems, potentially optimising CPU scheduling.
2024-11-25 10:16:10 -05:00
Michael R. Crusoe
3ce9d5d3bb More temp directories for tests 2024-11-22 09:55:04 -05:00
Michael R. Crusoe
d371061a19 ci: make most directories read-only before running the tests 2024-11-22 09:55:04 -05:00
Vladimir
bad48d8e2a implement with_capacity for WriteBatch (#947)
* implement `with_capacity` for `WriteBatch`

* add tests for WriteBatch::with_capacity

* update changelog
 - remove `clippy.toml` because we already have `msrv` in `Cargo.toml`
2024-11-22 08:19:32 -05:00
Michael R. Crusoe
1e3538dc51 tests: use tempfile instead of the current working directory 2024-11-14 08:10:59 -05:00
Congyu
329ae1a39e Allow using static bindgen feature (#939) 2024-11-14 08:10:59 -05:00
Stu Hood
5d1ba67a70 Fix column family creation race. 2024-11-14 08:10:59 -05:00
Timothy Redaelli
99fa2eee24 add missing supported bsd oses
Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
2024-11-14 08:10:59 -05:00
Michael R. Crusoe
49d95ded6e Fix two tests that want to write to the current working directory (#938)
To instead write to a temporary directory.
2024-11-14 08:10:59 -05:00
Zaidoon Abd Al Hadi
bf50543617 Release 0.33.0 2024-11-01 13:37:14 -04:00
Zaidoon Abd Al Hadi
6dad602f81 upgrade to RocksDB 9.7.4 2024-11-01 13:34:08 -04:00
Zaidoon Abd Al Hadi
091d9cc7c3 Release 0.32.0 2024-10-23 12:05:39 -04:00
Zaidoon Abd Al Hadi
a256738323 upgrade to RocksDB 9.7.3 2024-10-23 11:51:12 -04:00
Jason Volk
c3a637a46b Decrement refcount after registering info loggers.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-23 10:11:55 -04:00
Zaidoon Abd Al Hadi
63f7911dac Release 0.31.0 2024-10-16 02:07:30 -04:00
Zaidoon Abd Al Hadi
302f5615d2 fix security audit 2024-10-16 01:27:58 -04:00
Zaidoon Abd Al Hadi
54398accd9 fix audit check for real 2024-10-16 01:09:56 -04:00
Zaidoon Abd Al Hadi
41fc1e6aca upgrade to RocksDB 9.7.2 2024-10-16 00:56:29 -04:00
Zaidoon Abd Al Hadi
6cdf1f3d50 manually generate Cargo.lock to fix sec audit 2024-10-16 00:18:51 -04:00
Jason Volk
568039b9e0 Allow setting logging callback.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-10-15 23:50:45 -04:00
Niklas Fiekas
484d12d05c Fix unsoundness via impure AsRef (#705)
* Fix unsoundness via impure AsRef

---------

Co-authored-by: Oleksandr Anyshchenko <aanischenko@gmail.com>
Co-authored-by: Zaidoon Abd Al Hadi <43054535+zaidoon1@users.noreply.github.com>
2024-09-20 03:34:28 -04:00
Johnny Graettinger
61acabcb7f add Env::from_raw constructor (#545)
Support usages where the caller already has an environment built by an
alternative means, which the Env of this crate should take ownership of.

Co-authored-by: Zaidoon Abd Al Hadi <zaidoon@cloudflare.com>
2024-09-20 03:34:28 -04:00
Joel Höner
bf27d1c010 Expose LRU cache options (#837) 2024-09-19 02:47:34 -04:00
Zaidoon Abd Al Hadi
fa6fab774e Release 0.30.0 2024-09-06 16:52:55 -04:00
Zaidoon Abd Al Hadi
6156697589 upgrade to RocksDB 9.6.1 2024-09-06 16:28:52 -04:00
rockeet
5dd649fca4 Improve statistics by auto gen enum Ticker & enum Histogram (#924)
* Improve statistics by auto gen enum Ticker & enum Histogram

1. librocksdb-sys/Makefile: Add gen_statistics and gen_statistics.bash,
     make -C librocksdb-sys gen_statistics will generate 2 files:
       src/statistics_enum_ticker.rs
       src/statistics_enum_histogram.rs

2. In statistics.rs, we include! these 2 files and remove old hand
   writing enum Tickers & enum Histograms.

3. File gen_statistics.bash is used for generating these 2 files
   which is called in Makefile.
2024-09-06 15:41:12 -04:00
Zaidoon Abd Al Hadi
6fe9ba6489 Release 0.29.0 2024-08-21 14:57:56 -04:00
Zaidoon Abd Al Hadi
f9facd33e1 upgrade to RocksDB 9.5.2 2024-08-21 12:54:15 -04:00
4TT1L4
ef643d8dbc TransactionDB support in MemoryUsageBuilder #910 (#909) 2024-08-03 21:50:29 -04:00
June 🍓🦴
66a927e23e use the provided system rocksdb prebuilt on freebsd (#908)
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-08-01 17:35:01 -04:00
Jacob Pratt
0f435b93ce Implement Sync for BoundColumnFamily 2024-07-30 01:06:05 -04:00
Zaidoon Abd Al Hadi
d7e05e75dd Release 0.28.1 2024-07-26 20:00:17 -04:00
Larry
87063fcd95 Improvements to user defined timestamp (#905) 2024-07-26 18:02:44 -04:00
4TT1L4
5cb9b1acc0 feat: Properties for TransactionDB #899 (#902) 2024-07-26 18:02:44 -04:00
Arnaud Gourlay
d82b9682c2 Bump lz4 1.10 (#906) 2024-07-26 18:02:44 -04:00
Siyuan Zhang
dbb661dbb5 Support user defined timestamp in rust bindings (#901) 2024-07-15 06:56:24 -04:00
Lucas.Xu
57e8193e10 fix: android build in 32-bit devices (#869) 2024-07-14 22:19:05 -04:00
strawberry
a8fdc80295 bump tikv-jemalloc-sys to 0.6
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-14 20:21:39 -04:00
strawberry
f835b3ae4c allow unprefixed musl jemalloc targets
Signed-off-by: strawberry <strawberry@puppygock.gay>
2024-07-14 20:21:39 -04:00
Zaidoon Abd Al Hadi
4056a3b0f8 Release 0.28 2024-07-13 01:08:01 -04:00
Zaidoon Abd Al Hadi
8025bfb6f4 upgrade to RocksDB 9.4.0 2024-07-13 00:28:41 -04:00
Matt Jurik
ffdc5af31d Add support for enabling blob cache (#898)
* Add support for enabling blob cache

---------

Co-authored-by: Matt Jurik <matt.jurik@hulu.com>
2024-07-12 23:46:20 -04:00
Zaidoon Abd Al Hadi
db1ba33c2b Release 0.27.1 2024-07-07 13:52:36 -04:00
Zaidoon Abd Al Hadi
4ce943f2f8 enable experimental feature in zstd-sys
This will allow using zstd-static-linking-only  if enabled
2024-07-07 13:33:36 -04:00
Zaidoon Abd Al Hadi
123d1f293f fix stats comments 2024-07-07 11:58:27 -04:00
Zaidoon Abd Al Hadi
2ab6f052b1 add feature flag to enable ZSTD_STATIC_LINKING_ONLY 2024-07-07 11:50:22 -04:00
Zaidoon Abd Al Hadi
b4887edfb8 Add block based metadata cache options 2024-06-30 17:06:06 -04:00
Zaidoon Abd Al Hadi
be89ccbeea update changelog 2024-06-29 01:57:41 -04:00
Zaidoon Abd Al Hadi
8c212d4d69 Release 0.27.0 2024-06-29 01:52:34 -04:00
Zaidoon Abd Al Hadi
d138c0efdc Add option set_compaction_pri 2024-06-28 23:04:05 -04:00
Zaidoon Abd Al Hadi
6db8312ea7 upgrade to RocksDB 9.3.1 2024-06-28 21:55:47 -04:00
Zaidoon Abd Al Hadi
e19f4f0d15 clean up rate limiter object properly for set_ratelimiter_with_mode 2024-06-07 19:59:33 -04:00
w41ter
dd21604954 add option to enable auto tuned ratelimiter 2024-06-07 19:59:33 -04:00
walter
a62ebbb341 Add option set_avoid_unnecessary_blocking_io (#890) 2024-06-04 10:50:19 -04:00
Zaidoon Abd Al Hadi
e9e1cb5ba9 update CHANGELOG 2024-06-02 05:25:40 -04:00
w41ter
6d97d11005 port all value of ReadTier 2024-05-31 01:30:37 -04:00
Zaidoon Abd Al Hadi
368922d31b upgrade pinned clippy/rust-toolchain versions to 1.75 2024-05-25 21:01:53 -04:00
Congyu WANG
a0a7c35973 add clippy msrv and some clippy fixes 2024-05-25 21:01:53 -04:00
katelyn martin
e92d3daa3b toolchain: 📌 pin toolchain to rust 1.70.0
in CI, we specify the rust version as 1.70.0...

```yaml
on: [push, pull_request]
env:
  RUST_VERSION: 1.70.0
```

likewise, the package manifest pins the rust version...

```toml
rust-version = "1.70.0"
```

..but this version is not pinned by cargo, via a `rust-toolchain`. this
means that testing this project using the stable toolchain by default
(_at time of writing, this is 1.78.0_) will see test failures due to
error messages not matching the expected snapshots, due to `rustc`
itself making changes to its diagnostics:

```
test tests/fail/snapshot_outlive_db.rs ... mismatch

EXPECTED:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0597]: `db` does not live long enough
 --> tests/fail/snapshot_outlive_db.rs:6:9
  |
4 |     let _snapshot = {
  |         --------- borrow later stored here
5 |         let db = DB::open_default("foo").unwrap();
  |             -- binding `db` declared here
6 |         db.snapshot()
  |         ^^^^^^^^^^^^^ borrowed value does not live long enough
7 |     };
  |     - `db` dropped here while still borrowed
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈

ACTUAL OUTPUT:
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
error[E0597]: `db` does not live long enough
 --> tests/fail/snapshot_outlive_db.rs:6:9
  |
4 |     let _snapshot = {
  |         --------- borrow later stored here
5 |         let db = DB::open_default("foo").unwrap();
  |             -- binding `db` declared here
6 |         db.snapshot()
  |         ^^ borrowed value does not live long enough
7 |     };
  |     - `db` dropped here while still borrowed
┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈
note: If the actual output is the correct output you can bless it by rerunning
      your test with the environment variable TRYBUILD=overwrite
```

this commit introduces a `rust-toolchain.toml` file so that the correct
version of rust is used by those building or contributing to this
project.
2024-05-25 21:01:53 -04:00
Zaidoon Abd Al Hadi
18c2ac38cc update README to include rules around upgrade rust version 2024-05-25 19:58:07 -04:00
Zaidoon Abd Al Hadi
3d55dd3f33 Release 0.26.0 2024-05-24 02:09:28 -04:00
Zaidoon Abd Al Hadi
333f73c951 upgrade to RocksDB 9.2.1 2024-05-23 21:51:17 -04:00
Vladimir Petrzhikovskii
6f0afedb3c docs: document that default cf doesn't inherit db open options 2024-05-08 17:07:09 -04:00
Oleksandr Anyshchenko
5678254634 Bump snappy to 1.2.0 (#883) 2024-05-02 11:17:23 -04:00
Vadim Suharnikov
c5cd6bd251 Add delete_range to OptimisticTransactionDB (#879) 2024-04-28 15:44:05 -04:00
Zaidoon Abd Al Hadi
d3f07a9274 Release 0.25.0 2024-04-23 00:37:55 -07:00
Zaidoon Abd Al Hadi
f3a6ec1589 Update to RocksDB 9.1.1 2024-04-23 00:12:32 -07:00
Zaidoon Abd Al Hadi
938c969c50 Release 0.24.0 2024-04-18 20:36:13 -04:00
Zaidoon Abd Al Hadi
ed83fe103c Update to RocksDB 9.1.0 2024-04-18 20:21:16 -04:00
zaidoon
75b0264ef1 update README to document the various crate features that can be enabled
Also remove unused code in ci workflow
2024-04-06 04:20:23 -04:00
zaidoon
4a6bb9db41 Release 0.23.2 2024-03-30 00:41:43 -04:00
zaidoon
b87cd20e55 fix set_options_from_string binding 2024-03-30 00:27:16 -04:00
zaidoon
88d642c647 Release 0.23.1 2024-03-28 04:11:39 -04:00
Jason Volk
86f130be6d Add method to set DBOptions from string.
Signed-off-by: Jason Volk <jason@zemos.net>
2024-03-28 03:55:22 -04:00
Willem Olding
2516eddb55 Add linking libatomic command to build.rs to allow building for riscv64gc-unknown-linux-gnu target (#875) 2024-03-25 05:48:07 -04:00
widagdos
69ef18ed1d Make BackupEngine Send
BackupEngine is a simple pointer wrapper, so it's safe to send to another thread since the underlying RocksDB backup engine is thread-safe.
2024-03-25 05:48:07 -04:00
Saul
81f2a41f9a Add readme for mt_static feature. 2024-03-25 05:48:07 -04:00
zaidoon
1e01f90866 fix histogram stats after enum re-shuffle introduced in rocksdb v9.0 2024-03-25 03:56:20 -04:00
zaidoon
78a8a2e993 clippy fixes and comment clean up 2024-03-21 14:55:05 -04:00
zaidoon
5af8f56f4c make ColumnFamily Sync 2024-03-21 14:55:05 -04:00
zaidoon
fb73945312 Release 0.23.0 2024-03-20 14:21:32 -04:00
zaidoon
c9114bf559 Allow setting stderr logger 2024-03-20 14:11:02 -04:00
zaidoon
2316fa78ee Revert "Add portable feature for RocksDB build"
This reverts commit 9dc5c32724.
2024-03-20 01:21:12 -04:00
zaidoon
33ef393e0b Revert "Update README.md with a new section for the portable feature"
This reverts commit 21ca2ff47f.
2024-03-20 01:21:12 -04:00
zaidoon
9880e74aa6 Expose rate limiter with mode feature 2024-03-20 01:01:45 -04:00
zaidoon
4b8491b9db Update to RocksDB 9.0.0 2024-03-19 16:28:50 -04:00
zaidoon
60f783b06b Release 0.22.8 2024-03-15 13:58:32 -04:00
zaidoon
4b9f604a98 update librocksdb-sys to be rust-librocksdb-sys 2024-03-15 13:55:12 -04:00
Sujay Jayakar
21ca2ff47f Update README.md with a new section for the portable feature 2024-03-15 13:55:12 -04:00
Sujay Jayakar
9dc5c32724 Add portable feature for RocksDB build 2024-03-15 13:55:12 -04:00
Ruan Petterson
5af6a363ea fix: ptr::copy requires both ptrs to be non-null 2024-03-15 13:55:12 -04:00
Arsh
def38aedf2 Feat: Adds crt_static method (#865) 2024-03-15 13:55:12 -04:00
zaidoon
8b9e0b73d0 more ci clean up 2024-03-11 19:41:17 -04:00
zaidoon
a2e9aa0bc2 replace unmaintained dev dependency 2024-03-11 03:22:19 -04:00
zaidoon
0f8435b8f1 fix clippy warning 2024-03-10 11:21:18 -04:00
zaidoon
ad4bdcff4d modernize CI and other CI related clean up 2024-03-10 11:21:18 -04:00
zaidoon
3e4a0f632a Expose io-timeout/deadline read options 2024-03-03 20:52:03 -05:00
zaidoon
11d2facb1e Release 0.22.7 2024-03-02 22:55:31 -05:00
zaidoon
bb1c93400c don't use system jemalloc 2024-03-02 22:37:48 -05:00
zaidoon
2fbae42de8 Release 0.22.6 2024-02-27 22:43:42 -05:00
zaidoon
02ac6b1fac Expose set_ttl 2024-02-27 22:29:47 -05:00
zaidoon
10e28ec2d4 Update to RocksDB 8.11.3 2024-02-27 22:03:42 -05:00
Zaidoon Abd Al Hadi
1d58df5b67
Merge pull request #24 from zaidoon1/zaidoon/0.22.5
Release 0.22.5
2024-02-26 19:28:21 -05:00
zaidoon
4494b2dd48 Release 0.22.5 2024-02-26 14:27:18 -05:00
zaidoon
a2ca8cf109 actually enable jemalloc when feature is used on linux 2024-02-26 14:23:17 -05:00
zaidoon
528bbed577 gate malloc-usable-size to linux only 2024-02-25 21:20:56 -05:00
zaidoon
100d7aef62 add feature flag to enable malloc-usable-size used by optimize_filtes_for_memory feature 2024-02-25 16:06:06 -05:00
zaidoon
9a0a3b4c29 Release 0.22.4 2024-02-20 20:56:40 -05:00
zaidoon
358d430b0a Update to RocksDB 8.10.2 2024-02-20 20:49:43 -05:00
Zaidoon Abd Al Hadi
237e973dd2 Fix build status badge and other bits in README.md
---------

Co-authored-by: Jordan Danford <jordandanford@gmail.com>
2024-02-20 19:47:48 -05:00
zaidoon
5853d575ce Release 0.22.3 2024-02-13 09:34:18 -05:00
Ahmed Farghal
7d0f2f049d Export memory usage builder and MemoryUsage structs to users (#854) 2024-02-13 09:20:33 -05:00
Jan Segre
3766fe2aec Make FlushOptions Send and Sync (#860) 2024-02-13 09:20:33 -05:00
zaidoon
e2b5cafc5b update README to link to original rust rocksdb repo 2024-02-12 23:58:09 -05:00
zaidoon
65b5eaf876 Release 0.22.2 2024-02-12 22:51:46 -05:00
Ahmed Farghal
8fdd559b59 Expose rocksdb cumulative statistics and histograms (#853) 2024-02-11 10:39:19 -05:00
zaidoon
c2fd008e51 update README 2024-02-10 14:37:11 -05:00
zaidoon
189528ce10 exclude files from librocksdb-sys to reduce package size 2024-02-10 14:23:05 -05:00
zaidoon
8f65a73f09 Release 0.22.0 2024-02-10 13:24:17 -05:00
zaidoon
d403f6af8b remove profile release 2024-02-10 13:16:25 -05:00
zaidoon
99b9fdcfa8 release profile optimizations and formatting 2024-02-10 13:11:38 -05:00
zaidoon
3516039e5b rename librocksdb-sys library 2024-02-10 13:00:52 -05:00
zaidoon
0b821d30dc Release 0.22.0 2024-02-10 12:18:53 -05:00
zaidoon
3041bc576c more fixes after renaming package 2024-02-10 11:38:44 -05:00
zaidoon
75cbac8197 update code imports after package name change and clean up README/MAINTAINERHSIP 2024-02-10 10:45:49 -05:00
zaidoon
592f0849b4 update README and package name 2024-02-10 10:27:51 -05:00
Zaidoon Abd Al Hadi
8526d0c8c4
Merge pull request #1 from zaidoon1/zaidoon/bump-dependencies
bump dependencies & upgrade to latest rust version
2024-02-10 09:46:54 -05:00
zaidoon
e2adfb16b0 bump dependencies & upgrade to latest rust version 2024-02-10 05:12:58 -05:00