revision-id: 398dfcdbfc0ba803f1da9b936deff2c893fe29ed (fb-prod201903-263-g398dfcdbfc0) parent(s): c62e560ba5d692ac1af5cfb954aa9b36b9c98b35 author: Sergei Petrunia committer: Sergei Petrunia timestamp: 2019-11-30 16:43:52 +0300 message: Fix rocksdb.ttl_primary_read_filtering test In Range-Locking mode, DML statement not necessarily creates a snapshot. Introduce/call Rdb_transaction::locking_iter_created() which will note the current_timestamp, like Rdb_transaction::snapshot_created does. We should take only the time of the first call. --- storage/rocksdb/ha_rocksdb.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/storage/rocksdb/ha_rocksdb.cc b/storage/rocksdb/ha_rocksdb.cc index 9743b0b3ee9..262af4816f1 100644 --- a/storage/rocksdb/ha_rocksdb.cc +++ b/storage/rocksdb/ha_rocksdb.cc @@ -2825,6 +2825,11 @@ class Rdb_transaction { m_is_delayed_snapshot = false; } + void locking_iter_created() { + if (!m_snapshot_timestamp) + rdb->GetEnv()->GetCurrentTime(&m_snapshot_timestamp); + } + virtual void acquire_snapshot(bool acquire_now) = 0; virtual void release_snapshot() = 0; @@ -3615,8 +3620,10 @@ class Rdb_transaction_impl : public Rdb_transaction { bool is_rev_cf, bool use_locking_iterator) override { global_stats.queries[QUERIES_RANGE].inc(); - if (use_locking_iterator) + if (use_locking_iterator) { + locking_iter_created(); return GetLockingIterator(m_rocksdb_tx, options, column_family, is_rev_cf); + } else return m_rocksdb_tx->GetIterator(options, column_family); }