Skip to content

Commit

Permalink
Delete iterator in replication_test
Browse files Browse the repository at this point in the history
  • Loading branch information
igorcanadi committed Oct 20, 2023
1 parent 68c758a commit 0bf47a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cloud/replication_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1315,13 +1315,15 @@ TEST_F(ReplicationTest, SuperSnapshot) {
ASSERT_OK(follower->Get(ro, "k1", &val));
EXPECT_EQ(val, "v1");

auto iter = follower->NewIterator(ro, follower->DefaultColumnFamily());
auto iter = std::unique_ptr<rocksdb::Iterator>(
follower->NewIterator(ro, follower->DefaultColumnFamily()));
iter->SeekToFirst();
EXPECT_TRUE(iter->Valid());
EXPECT_EQ(iter->key(), "k1");
EXPECT_EQ(iter->value(), "v1");
iter->Next();
EXPECT_FALSE(iter->Valid());
iter.reset();

ro.snapshot = nullptr;
ASSERT_OK(follower->Get(ro, followerCF("cf1"), "cf1k1", &val));
Expand Down
2 changes: 2 additions & 0 deletions db/db_impl/db_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4077,6 +4077,8 @@ Status DBImpl::GetSuperSnapshots(
return Status::InvalidArgument(
"GetSuperSnapshots only supported in RocksDB compiled with USE_RTTI=1");
#endif
InstrumentedMutexLock l(&mutex_);

if (!is_snapshot_supported_) {
return Status::InvalidArgument("Snapshot not supported");
}
Expand Down

0 comments on commit 0bf47a9

Please sign in to comment.