From e0f9d11a05ec2cddd83c46fd063824721ea26670 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 20 Dec 2019 22:08:44 -0800 Subject: [PATCH] db_stress should not keep manifest files under checkpoint directory (#6233) Summary: Recently db_stress starts to use a special Env that keeps all manifest files. This should not apply to checkpoint directory and causes test failure like this: Verification failed: Checkpoint gave inconsistent state. Status is IO error: While mkdir: /dev/shm/rocksdb/rocksdb_crashtest_whitebox/.checkpoint27.tmp: File exists Pull Request resolved: https://github.com/facebook/rocksdb/pull/6233 Test Plan: Run crash_test with high chance of checkpoint and make sure it doesn't reproduce. Differential Revision: D19207250 fbshipit-source-id: 12a931379e2e0572bb84aa658b6d03770c8551d4 --- db_stress_tool/db_stress_env_wrapper.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/db_stress_tool/db_stress_env_wrapper.h b/db_stress_tool/db_stress_env_wrapper.h index 35416641d..83e1f7391 100644 --- a/db_stress_tool/db_stress_env_wrapper.h +++ b/db_stress_tool/db_stress_env_wrapper.h @@ -20,8 +20,10 @@ class DbStressEnvWrapper : public EnvWrapper { // We determine whether it is a manifest file by searching a strong, // so that there will be false positive if the directory path contains the // keyword but it is unlikely. + // Checkpoint directory needs to be exempted. if (!if_preserve_all_manifests || - f.find("MANIFEST-") == std::string::npos) { + f.find("MANIFEST-") == std::string::npos || + f.find("checkpoint") != std::string::npos) { return target()->DeleteFile(f); } return Status::OK();