From 36b061a6c7dbba1460d40c9bae5883740b0076aa Mon Sep 17 00:00:00 2001 From: Yu Zhang Date: Mon, 5 Aug 2024 12:26:18 -0700 Subject: [PATCH] Fix test breakage (#12915) Summary: https://github.com/facebook/rocksdb/issues/12891 updated this deletion rate in the test to be much higher, which makes the test flaky. The rate is being intentionally set to very low to maximize the retention of a ".log.trash" file after DB closes. This PR just change it back. Pull Request resolved: https://github.com/facebook/rocksdb/pull/12915 Reviewed By: ltamasi Differential Revision: D60776312 Pulled By: jowlyzhang fbshipit-source-id: d193557a042c65816fcc337cceb09905e042e9f6 --- db/db_sst_test.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/db/db_sst_test.cc b/db/db_sst_test.cc index 248b3d9ece..5499d58f5f 100644 --- a/db/db_sst_test.cc +++ b/db/db_sst_test.cc @@ -917,11 +917,12 @@ TEST_P(DBWALTestWithParam, WALTrashCleanupOnOpen) { // Create 4 files in L0 for (char v = 'a'; v <= 'd'; v++) { if (v == 'c') { - // Maximize the change that the last log file will be preserved in trash - // before restarting the DB. + // Maximize the chance that the last log file will be preserved in trash + // before restarting the DB. (Enable slow deletion but at a very slow + // deletion rate) // We have to set this on the 2nd to last file for it to delay deletion // on the last file. (Quirk of DeleteScheduler::BackgroundEmptyTrash()) - options.sst_file_manager->SetDeleteRateBytesPerSecond(1024 * 1024); + options.sst_file_manager->SetDeleteRateBytesPerSecond(1); } ASSERT_OK(Put("Key2", DummyString(1024, v))); ASSERT_OK(Put("Key3", DummyString(1024, v)));