Skip to content

Document WriteBatchWithIndex prefix iterator behavior#14774

Open
richinmrudul wants to merge 1 commit into
facebook:mainfrom
richinmrudul:fix-wbwi-prefix-same-as-start
Open

Document WriteBatchWithIndex prefix iterator behavior#14774
richinmrudul wants to merge 1 commit into
facebook:mainfrom
richinmrudul:fix-wbwi-prefix-same-as-start

Conversation

@richinmrudul
Copy link
Copy Markdown

Summary:
Documents that WriteBatchWithIndex::NewIteratorWithBase cannot infer the ReadOptions or prefix extractor used to create the base iterator. In particular, prefix_same_as_start on the base iterator is not applied to keys from the write batch, so callers that need prefix-bounded iteration must enforce the prefix boundary themselves.

Adds a focused test showing that a plain DB iterator respects prefix_same_as_start while the merged WriteBatchWithIndex iterator can still return in-batch keys outside the seek prefix.

Refs #14610

Test Plan:
make write_batch_with_index_test -j8
./write_batch_with_index_test --gtest_filter='Prefix'
git diff --check
make check-sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant