@@ -3139,8 +3139,9 @@ void DBImpl::MultiGet(const ReadOptions& read_options, const size_t num_keys,
31393139 if (dynamic_cast <const SuperSnapshotImpl*>(read_options.snapshot )) {
31403140 for (size_t i = 0 ; i < num_keys; ++i) {
31413141 statuses[i] = Status::NotSupported (
3142- " MultiGet with timestamps does not support super snapshot " );
3142+ " This variant of MultiGet does not yet support super snapshots " );
31433143 }
3144+ return ;
31443145 }
31453146 // RocksDB-Cloud contribution end
31463147
@@ -3400,8 +3401,12 @@ void DBImpl::MultiGetWithCallback(
34003401 multiget_cf_data[0 ].super_version , consistent_seqnum,
34013402 read_callback);
34023403 assert (s.ok () || s.IsTimedOut () || s.IsAborted ());
3403- ReturnAndCleanupSuperVersion (multiget_cf_data[0 ].cfd ,
3404- multiget_cf_data[0 ].super_version );
3404+ // RocksDB-Cloud contribution begin
3405+ if (!dynamic_cast <const SuperSnapshotImpl*>(read_options.snapshot )) {
3406+ ReturnAndCleanupSuperVersion (multiget_cf_data[0 ].cfd ,
3407+ multiget_cf_data[0 ].super_version );
3408+ }
3409+ // RocksDB-Cloud contribution end
34053410}
34063411
34073412// The actual implementation of batched MultiGet. Parameters -
@@ -3844,10 +3849,12 @@ Iterator* DBImpl::NewIterator(const ReadOptions& read_options,
38443849 result = nullptr ;
38453850
38463851#else
3852+ // RocksDB-Cloud contribution begin
38473853 if (dynamic_cast <const SuperSnapshotImpl*>(read_options.snapshot )) {
38483854 return NewErrorIterator (Status::NotSupported (
38493855 " Tailing iterator not supported with super snapshot" ));
38503856 }
3857+ // RocksDB-Cloud contribution end
38513858
38523859 SuperVersion* sv = cfd->GetReferencedSuperVersion (this );
38533860 auto iter = new ForwardIterator (this , read_options, cfd, sv,
@@ -4077,6 +4084,8 @@ Status DBImpl::GetSuperSnapshots(
40774084 return Status::InvalidArgument (
40784085 " GetSuperSnapshots only supported in RocksDB compiled with USE_RTTI=1" );
40794086#endif
4087+ InstrumentedMutexLock l (&mutex_);
4088+
40804089 if (!is_snapshot_supported_) {
40814090 return Status::InvalidArgument (" Snapshot not supported" );
40824091 }
@@ -4092,7 +4101,8 @@ Status DBImpl::GetSuperSnapshots(
40924101 for (auto & cf : column_families) {
40934102 auto cfh = static_cast_with_check<ColumnFamilyHandleImpl>(cf);
40944103 auto cfd = cfh->cfd ();
4095- auto sv = cfd->GetReferencedSuperVersion (this );
4104+ auto sv = cfd->GetSuperVersion ();
4105+ sv->Ref ();
40964106 auto ss = new SuperSnapshotImpl (cfd, sv);
40974107 snapshots_.New (ss, snapshot_seq, unix_time,
40984108 /* is_write_conflict_boundary=*/ false );
0 commit comments