use specified comparator in CollapsedRangeDelMap (#4386)

Summary:
The Comparator passed to CollapsedRangeDelMap was not used for
operator less of the std::map `rep_` object contained in
CollapsedRangeDelMap. So the map was always sorted using the
default ByteWiseComparator, which seems wrong.

Passing the specified Comparator through for usage in that map
object fixes actual problems we were seeing with RangeDelete operations
that do not delete keys as expected when using a custom Comparator.

I found that the tests in current master crash when I run them locally,
both with and without my patch, at the very same location. I therefore
don't know if the patch breaks something else, but it seems to fix
RangeDeletion issues in our product that uses RocksDB.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4386

Differential Revision: D9916506

Pulled By: ajkr

fbshipit-source-id: 27bff8c775831f089dde8c5289df7343d88b2d66
main
jsteemann 6 years ago committed by Facebook Github Bot
parent 65ac72edd9
commit 27221b0cc2
  1. 4
      db/range_del_aggregator.cc

@ -173,7 +173,9 @@ class CollapsedRangeDelMap : public RangeDelMap {
const Comparator* ucmp_; const Comparator* ucmp_;
public: public:
CollapsedRangeDelMap(const Comparator* ucmp) : ucmp_(ucmp) { CollapsedRangeDelMap(const Comparator* ucmp)
: rep_(stl_wrappers::LessOfComparator(ucmp)),
ucmp_(ucmp) {
InvalidatePosition(); InvalidatePosition();
} }

Loading…
Cancel
Save