From 3717a882897dc94459944fd092eeb59b8992c045 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=8F=E4=B9=8B=E7=AB=A0?= Date: Wed, 11 Dec 2019 11:25:33 -0800 Subject: [PATCH] Fix UniversalCompaction trivial move bug (#6067) Summary: `curr.level` is `c->inputs_` index, not real level. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6067 Differential Revision: D18935726 fbshipit-source-id: 4354e6e9cd900ca56c96e9d770f0ab6634e45daf --- db/compaction/compaction_picker_universal.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/db/compaction/compaction_picker_universal.cc b/db/compaction/compaction_picker_universal.cc index 473a480cb..b1c9d0469 100644 --- a/db/compaction/compaction_picker_universal.cc +++ b/db/compaction/compaction_picker_universal.cc @@ -247,7 +247,8 @@ bool UniversalCompactionBuilder::IsInputFilesNonOverlapping(Compaction* c) { next.f = nullptr; - if (curr.level != 0 && curr.index < c->num_input_files(curr.level) - 1) { + if (c->level(curr.level) != 0 && + curr.index < c->num_input_files(curr.level) - 1) { next.f = c->input(curr.level, curr.index + 1); next.level = curr.level; next.index = curr.index + 1;