MySQLOnRocksDB/mysql-5.6
forked from facebook/mysql-5.6

Loading…
Modifications are not visible within transaction #19
So far I have found that changes are not visible when doing non-locking, range or full table scan.
I think the root cause is that changes (Rdb_transaction.changes -- Row_table)
are ignored at ha_rocksdb::rnd_next_with_direction() for non-locking
reads. For example, 1. create empty table, 2. begin; 3. insert; 4. select; => then select returns empty result. I confirmed scan_it->Valid() returned false at ha_rocksdb::rnd_next_with_direction(), without checking trx->changes.
I think merging trx->changes and scan_it is needed. I assume secondary index scan also needs merging too. Merging means:
- key existing only on trx->changes (including tombstone) => use trx->changes
- key existing only on scan_it => use scan_it
- key existing both (including tombstone) => use trx->changes
2 and 3 would be easy. 1 needs more discussions about how to implement efficiently.
I pushed rocksdb.transaction test case to cover insert/update/delete.
https://reviews.facebook.net/D31551 fixed this issue.
rocksdb.delete test case failed because deletes were not visible within transaction. Transactions are are currently started with GetSnapshot().