Skip to content
This repository was archived by the owner on Mar 1, 2026. It is now read-only.

Add refresh_iter to release pinned MemTable and SST#1212

Open
rockeet wants to merge 1 commit into
facebook:fb-mysql-8.0.28from
rockeet:fix.iter.pin.memtab
Open

Add refresh_iter to release pinned MemTable and SST#1212
rockeet wants to merge 1 commit into
facebook:fb-mysql-8.0.28from
rockeet:fix.iter.pin.memtab

Conversation

@rockeet

@rockeet rockeet commented Aug 15, 2022

Copy link
Copy Markdown
Contributor

During long running trx, there is a rocksdb::Version object is referenced by iterator, thus the MemTables and SSTs referenced by Version can not be released even the MemTables are flushed or SSTs are compacted.

This PR is intended for releasing MemTable and SST objects held by
rocksdb::Version object which referenced by old rocksdb::Iterator, newly
created Iterator may reference a newer rocksdb::Version object, The data
view of these 2 iterators are identical.

@yoshinorim

Copy link
Copy Markdown
Contributor

I read the diff and I think it is better to submit as a RocksDB PR (https://github.com/facebook/rocksdb) as a read option or a wrapper of Iterator, rather than MyRocks specific functions. Would you mind filing an issue in RocksDB (https://github.com/facebook/rocksdb/issues) first and see feedbacks? Snapshot has to be carried over for consistent reads, and your diff looks to take into account that already.

@rockeet

rockeet commented Aug 17, 2022

Copy link
Copy Markdown
Contributor Author

I read the diff and I think it is better to submit as a RocksDB PR (https://github.com/facebook/rocksdb) as a read option or a wrapper of Iterator, rather than MyRocks specific functions. Would you mind filing an issue in RocksDB (https://github.com/facebook/rocksdb/issues) first and see feedbacks? Snapshot has to be carried over for consistent reads, and your diff looks to take into account that already.

Thank you, I have filed such a RocksDB issue!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

3 participants