Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple code paths don't check InDomain() before using prefix extractor #5196

Open
yiwu-arbug opened this issue Apr 15, 2019 · 1 comment
Open

Comments

@yiwu-arbug
Copy link
Contributor

DBIter and HashSkipListRep don't check InDomain() before using prefix extractor, which can cause crash or unexpected behavior.

prefix_extractor_->Transform(ikey_.user_key)

auto transformed = memtable_rep_.transform_->Transform(ExtractUserKey(k));

Expected behavior

RocksDB either correctly handle keys out of domain of prefix extractor, or return error.

Actual behavior

RocksDB may crash.

Steps to reproduce the behavior

Insert keys not satisfying prefix extractor to the DB.

@anand1976
Copy link
Contributor

@yiwu-arbug Thanks for reporting. It looks like there are more places where Transform() is called without calling InDomain() first - HashLinkListRep, SkipListRep, PlainTable, and ForwardIterator.

@yiwu-arbug yiwu-arbug changed the title DBIter and HashSkipListRep don't check InDomain() before using prefix extractor Multiple code paths don't check InDomain() before using prefix extractor Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants