fix coredump for release nullptr

Summary:
Coredump will be triggered when ingest external sst file after delete range.
ref https://github.com/facebook/rocksdb/issues/2398
Closes https://github.com/facebook/rocksdb/pull/2463

Differential Revision: D5275599

Pulled By: ajkr

fbshipit-source-id: 0828dbc062ea8c74e913877cd63494fd3478a30d
main
zhangjinpeng1987 8 years ago committed by Facebook Github Bot
parent 0d278456c9
commit c430d69eed
  1. 2
      db/table_cache.cc

@ -286,9 +286,11 @@ InternalIterator* TableCache::NewRangeTombstoneIterator(
if (s.ok()) { if (s.ok()) {
result = table_reader->NewRangeTombstoneIterator(options); result = table_reader->NewRangeTombstoneIterator(options);
if (result != nullptr) { if (result != nullptr) {
if (handle != nullptr) {
result->RegisterCleanup(&UnrefEntry, cache_, handle); result->RegisterCleanup(&UnrefEntry, cache_, handle);
} }
} }
}
if (result == nullptr && handle != nullptr) { if (result == nullptr && handle != nullptr) {
// the range deletion block didn't exist, or there was a failure between // the range deletion block didn't exist, or there was a failure between
// getting handle and getting iterator. // getting handle and getting iterator.

Loading…
Cancel
Save