This repository was archived by the owner on Mar 1, 2026. It is now read-only.
Rr snapshot#1510
Closed
laurynas-biveinis wants to merge 2 commits into
Closed
Conversation
…ference This is a second batch of cleanups from the repeatable read snapshot work. - Make rdb_get_rocksdb_db return reference instead of pointer, update callers and callees. Inline this function in ha_rocksdb_proto.h, move rdb declaration there to support inlining in detail namespace as documentation that it should not be accessed directly. Update ha_rocksdb.cc itself to use rdb_get_rocksdb_db instead of rdb. Remove many redudant rdb != nullptr checks and asserts. - Introduce rdb_snapshot_unique_ptr with a custom deleter and a factory function get_rdb_snapshot to manager global RocksDB snapshots - Make Rdb_explicit_snapshot create the snapshot itself, by calling get_rdb_snapshot, instead of receiving one through parameters, simplify its signature. - Replace rocksdb::ManagedSnapshot uses with rdb_snapshot_unique_ptr ones. - Remove rarely-used explicit transaction snapshot assignment code from acquire_snapshot and move it to the few callers where it may happen. Add new method Rdb_transaction::has_explicit_or_read_only_snapshot to support this. - For Rdb_transaction, make m_insert_count, m_update_count, m_delete_count, m_auto_incr_map, & m_rollback_only fields private instead of protected. Move their reset at the end of committed or rolledback transactions to on_finish method in the base class. Remove redundant m_writes_at_last_savepoint reset in set_initial_savepoint. - Add several asserts.
Make MyRocks isolation behavior closer to that of InnoDB: - All data-writing SQL statements, and read statements under READ COMMITTED isolation level take a RocksDB snapshot at the beginning of the statement, and release it at the end. - Data-reading SQL statements under REPEATABLE READ share a RocksDB snapshot which is acquired on a first such statement and released at the end of a transaction. The above causes other user-visible changes: - rocksdb_skip_snapshot_validation system variable becomes a no-op. This variable should be removed at a later time. - SHOW ENGINE ROCKSDB STATUS output is extended with RR read snapshot information. Implementation details: - Introduce new possible value for Rdb_transaction::statement_snapshot_type: snapshot_type::RR, set iff performing a read under RR. - Introduce Rdb_transaction::end_stmt method, to be called at the end of each MyRocks-involving SQL statement in a transaction, and virtual method release_stmt_snapshot with implementation for both regular and WB transactions. - Unify existing code to restore an older RocksDB snapshot if a statement failed, as well as the code to release snapshots at the end of RC statements.
Contributor
Author
|
Creating a draft PR because it contains a prerequisite commits, which is PR'ed separately. Will be rebased after the prerequisite is merged |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
No description provided.