wip: chore: Update to origin/zaidoon/10.10.1, latest RocksDB, fix a few bugs #5
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
continuwuation/rust-rocksdb-zaidoon1!5
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "gamesguru/rust-rocksdb-zaidoon1:master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
TODO: Updating commit hash in
continuwuityproject depends first upon this PR's merge commit being added to history. The submodule,librocksdb-sys/rocksdb, also needs a separate PR opened. The second submodule,snappy, I don't know if we need or use.As well, we might consider distancing ourselves from this 3rd party wrapper
(in light of the portable ability to compile RocksDB statically as a shared object
*.sofile).This rust wrapper potentially just a security vulnerability for those not keen on C++.
Release notes are here:
FlushOptionsSendandSync(#860) 3766fe2aec1.70.0e92d3daa3bin 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.SyncforBoundColumnFamily0f435b93ce* 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.with_capacityforWriteBatch(#947) bad48d8e2aCXXSTDLIB(#1029) db068c631fThe 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 -------* feat: expose {enable,disable}_file_deletions Closes #1034chore: Update toto wip: chore: Update toorigin/zaidoon/10.10.1, latest RocksDB, fix a few bugsorigin/zaidoon/10.10.1, latest RocksDB, fix a few bugsView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.