Open
Conversation
9022202 to
9091659
Compare
glevco
approved these changes
Apr 30, 2026
There was a problem hiding this comment.
Pull request overview
This PR restores build compatibility with RocksDB v11 by introducing a C++ shim layer that normalizes the rocksdb::DB::Open* APIs across RocksDB versions, and updating the Cython bindings to call through that shim.
Changes:
- Added
rocksdb/cpp/db_helpers.hppto providepy_rocks::DBOpen*wrappers that adapt RocksDB’s newerstd::unique_ptr-basedOpen*APIs to the existingDB**shape used by the Cython bindings. - Updated
rocksdb/db.pxdto bindDB_Open*symbols to the new shim functions. - Updated
DB.close()to explicitly destroy the nativerocksdb::DB*afterClose(). - Bumped package version to
0.10.1.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
rocksdb/db.pxd |
Redirects DB open bindings to shim functions in cpp/db_helpers.hpp, and exposes DB_Destroy. |
rocksdb/cpp/db_helpers.hpp |
New compatibility wrappers for RocksDB DB::Open* / OpenAsSecondary* / OpenForReadOnly* across versions. |
rocksdb/_rocksdb.pyx |
Ensures the native rocksdb::DB* is deleted during DB.close() to avoid leaks and match new open behavior. |
pyproject.toml |
Version bump to 0.10.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
1569
to
1572
| with nogil: | ||
| st = self.db.Close() | ||
| db.DB_Destroy(self.db) | ||
| self.db = NULL |
There was a problem hiding this comment.
Maybe this is important to be able to avoid corrupting the DB in certain situations?
Member
Author
There was a problem hiding this comment.
On rocksdb, a close cannot fail, if anything errors it's left on the filesystem, not on the DB struct.
luislhl
approved these changes
May 5, 2026
9091659 to
1fd7272
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build broke on macOS after rocksdb was updated to v11 on homebrew. This PR introduces a small shim to to fix support and restore compatibility.