提交 01ebe8a5 编写于 作者: A anand76 提交者: Facebook GitHub Bot

Fix invalid reference in MultiGet due to vector resizing (#10702)

Summary:
Fix invalid reference in MultiGet due to resizing of the ```batches``` autovector.

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

Test Plan: Run asan crash test

Reviewed By: riversand963

Differential Revision: D39608753

Pulled By: anand1976

fbshipit-source-id: 7a9e7fc6f436f08eb22003d0e6b0e1e4dcdc1a2a
上级 2cc5b395
......@@ -2776,6 +2776,11 @@ Status Version::MultiGetAsync(
to_process.emplace_back(0);
while (!to_process.empty()) {
// As we process a batch, it may get split into two. So reserve space for
// an additional batch in the autovector in order to prevent later moves
// of elements in ProcessBatch().
batches.reserve(batches.size() + 1);
size_t idx = to_process.front();
FilePickerMultiGet* batch = &batches.at(idx);
unsigned int num_tasks_queued = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册