From b1f62be10e7ab0e632b42ff5c51b2d1d476af21f Mon Sep 17 00:00:00 2001 From: Yanqin Jin Date: Wed, 14 Apr 2021 23:39:35 -0700 Subject: [PATCH] Use the right level (L0) for files written during WAL recovery (#8187) Summary: As the name of `DBImpl::WriteLevel0TableForRecovery` suggests, the resulting table file should be placed on L0. However, the argument `level` passed to `BuildTable()` is -1. We need to correct this since the level information will be useful to determine file placement. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8187 Test Plan: make check Reviewed By: ltamasi Differential Revision: D27748570 Pulled By: riversand963 fbshipit-source-id: e1cd23128a8de31f14b1edc2ea92754c154e4f10 --- db/db_impl/db_impl_open.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/db_impl/db_impl_open.cc b/db/db_impl/db_impl_open.cc index f51303d00..b7c5ead92 100644 --- a/db/db_impl/db_impl_open.cc +++ b/db/db_impl/db_impl_open.cc @@ -1383,7 +1383,7 @@ Status DBImpl::WriteLevel0TableForRecovery(int job_id, ColumnFamilyData* cfd, mutable_cf_options.compression_opts, paranoid_file_checks, cfd->internal_stats(), TableFileCreationReason::kRecovery, &io_s, io_tracer_, &event_logger_, job_id, Env::IO_HIGH, - nullptr /* table_properties */, -1 /* level */, current_time, + nullptr /* table_properties */, 0 /* level */, current_time, 0 /* oldest_key_time */, write_hint, 0 /* file_creation_time */, db_id_, db_session_id_, nullptr /*full_history_ts_low*/, &blob_callback_);