Skip to content

Conversation

@ruojieranyishen
Copy link
Contributor

@ruojieranyishen ruojieranyishen commented Jan 17, 2026

use https://github.com/zaidoon1/rust-rocksdb to replcae https://github.com/rust-rocksdb/rust-rocksdb

Summary by CodeRabbit

  • Chores

    • Updated RocksDB dependency to a git-based source with an explicit branch for continuous tracking.
  • Refactor

    • Optimized storage batch write handling across modules for improved resource and memory efficiency.
    • Consolidated duplicate authentication message construction to reduce redundancy and simplify logic.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 17, 2026

📝 Walkthrough

Walkthrough

The PR switches the RocksDB dependency to a git-based fork and updates internal RocksDB batch write call sites to pass WriteBatch by reference. It also refactors RAFT network authentication to compute the HMAC message string once and reuse it.

Changes

Cohort / File(s) Summary
Dependency Management
Cargo.toml
Replace rocksdb = { version = "0.23.0", features = ["multi-threaded-cf"] } with rocksdb = { package = "rust-rocksdb", git = "https://github.com/zaidoon1/rust-rocksdb", branch = "master", features = ["multi-threaded-cf"] }.
RocksDB Write Call Sites
src/engine/src/rocksdb_engine.rs, src/raft/src/snapshot.rs, src/raft/src/storage/backend.rs
Change WriteBatch argument passing from ownership moves to borrowed references (e.g., self.db.write(&batch) / snapshot_db.write(&batch)) across multiple write calls. No public API changes.
RAFT Network Refactor
src/raft/src/network.rs
Extract computation of message_str once and reuse it in add_authentication and verify_authentication, removing duplicated match logic used to build HMAC input.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • AlexStocks

Poem

🐰 A forked rocksdb hops into place,
Batches borrowed, no ownership chase,
Network sings a single line,
Duplication trimmed, tidy and fine,
I nibble bugs and leave a grace. 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 37.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: replacing the rocksdb dependency source from the official repository to an alternative fork, which is reflected in the Cargo.toml modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions bot added the ✏️ Feature new feature label Jan 17, 2026
@guozhihao-224
Copy link
Collaborator

lgtm

@AlexStocks AlexStocks merged commit 1c6cacd into arana-db:main Jan 17, 2026
16 checks passed
@ruojieranyishen ruojieranyishen deleted the checkroscksdbrepo branch January 17, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

✏️ Feature new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants