]> git-server-git.apps.pok.os.sepia.ceph.com Git - rocksdb.git/commit
Fix bug with kHashSearch and changing prefix_extractor with SetOptions (#10128)
authorPeter Dillinger <peterd@fb.com>
Fri, 10 Jun 2022 15:51:45 +0000 (08:51 -0700)
committerFacebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
Fri, 10 Jun 2022 15:51:45 +0000 (08:51 -0700)
commitd3a3b02134e9a71012fbdeeca2f4e0fb9b745312
tree425634b0bdb1c67dcd2d8bd8b943c3185c033230
parent693dffd8e8e9133519d3adba9cd817adc0a995ba
Fix bug with kHashSearch and changing prefix_extractor with SetOptions (#10128)

Summary:
When opening an SST file created using index_type=kHashSearch,
the *current* prefix_extractor would be saved, and used with hash index
if the *new current* prefix_extractor at query time is compatible with
the SST file. This is a problem if the prefix_extractor at SST open time
is not compatible but SetOptions later changes (back) to one that is
compatible.

This change fixes that by using the known compatible (or missing) prefix
extractor we save for use with prefix filtering. Detail: I have moved the
InternalKeySliceTransform wrapper to avoid some indirection and remove
unnecessary fields.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10128

Test Plan:
expanded unit test (using some logic from https://github.com/facebook/rocksdb/issues/10122) that fails
before fix and probably covers some other previously uncovered cases.

Reviewed By: siying

Differential Revision: D36955738

Pulled By: pdillinger

fbshipit-source-id: 0c78a6b0d24054ef2f3cb237bf010c1c5589fb10
HISTORY.md
db/db_test.cc
db/dbformat.h
table/block_based/block_based_table_reader.cc
table/block_based/block_based_table_reader.h
table/block_based/block_prefix_index.cc
table/block_based/block_prefix_index.h
table/block_based/hash_index_reader.cc