Skip to content

Commit 0bf47a9

Browse files
committed
Delete iterator in replication_test
1 parent 68c758a commit 0bf47a9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

cloud/replication_test.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,13 +1315,15 @@ TEST_F(ReplicationTest, SuperSnapshot) {
13151315
ASSERT_OK(follower->Get(ro, "k1", &val));
13161316
EXPECT_EQ(val, "v1");
13171317

1318-
auto iter = follower->NewIterator(ro, follower->DefaultColumnFamily());
1318+
auto iter = std::unique_ptr<rocksdb::Iterator>(
1319+
follower->NewIterator(ro, follower->DefaultColumnFamily()));
13191320
iter->SeekToFirst();
13201321
EXPECT_TRUE(iter->Valid());
13211322
EXPECT_EQ(iter->key(), "k1");
13221323
EXPECT_EQ(iter->value(), "v1");
13231324
iter->Next();
13241325
EXPECT_FALSE(iter->Valid());
1326+
iter.reset();
13251327

13261328
ro.snapshot = nullptr;
13271329
ASSERT_OK(follower->Get(ro, followerCF("cf1"), "cf1k1", &val));

db/db_impl/db_impl.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4077,6 +4077,8 @@ Status DBImpl::GetSuperSnapshots(
40774077
return Status::InvalidArgument(
40784078
"GetSuperSnapshots only supported in RocksDB compiled with USE_RTTI=1");
40794079
#endif
4080+
InstrumentedMutexLock l(&mutex_);
4081+
40804082
if (!is_snapshot_supported_) {
40814083
return Status::InvalidArgument("Snapshot not supported");
40824084
}

0 commit comments

Comments
 (0)