need to seek rocksdb iter to first
This commit is contained in:
1 parent
a98f88c872
commit
a43ee52795
2 files changed
+8
-8
No files matched your search
@@ -170,8 +170,10 @@ bool RocksDBStorageProvider::enumerate(callback fn) const
|
||||
|
||||
size_t RocksDBStorageProvider::stateful_enumerate(callback fn)
|
||||
{
|
||||
if (m_iter == nullptr || !m_iter->Valid())
|
||||
if (m_iter == nullptr || !m_iter->Valid()) {
|
||||
m_iter = std::unique_ptr<rocksdb::Iterator>(m_spdb->NewIterator(ReadOptions(), m_spcolfamily.get()));
|
||||
m_iter->SeekToFirst();
|
||||
}
|
||||
size_t count = 0;
|
||||
while (m_iter->Valid()) {
|
||||
if (FInternalKey(m_iter->key().data(), m_iter->key().size()))
|
||||
|
||||
@@ -122,15 +122,13 @@ if {$::flash_enabled} {
|
||||
|
||||
test { Keys in storage are expired } {
|
||||
r flushdb
|
||||
r psetex key1 1000 a
|
||||
r psetex key2 1000 a
|
||||
r psetex key3 1000 a
|
||||
r psetex key1 10000 a
|
||||
r psetex key2 10000 a
|
||||
r psetex key3 10000 a
|
||||
r flushall cache
|
||||
# Redis expires random keys ten times every second so we are
|
||||
# fairly sure that all the three keys should be evicted after
|
||||
# one second.
|
||||
|
||||
after 1000
|
||||
wait_for_condition 100 50 {
|
||||
wait_for_condition 1000 50 {
|
||||
[r dbsize] == 0
|
||||
} else {
|
||||
fail "keys in ssd only not expired"
|
||||
|
||||
Reference in new issue
Block a user