From d4c45428af62f7e8b6678a7314ffedfc70f60ed5 Mon Sep 17 00:00:00 2001 From: sdong Date: Mon, 25 Jul 2016 12:27:06 -0700 Subject: [PATCH] db_stress shouldn't assert file size 0 if file creation fails Summary: OnTableFileCreated() now is also called when the file creaion fails. In that case, we shouldn't assert the file size is not 0. Test Plan: Run crash test Reviewers: yiwu, andrewkr, IslamAbdelRahman Reviewed By: IslamAbdelRahman Subscribers: IslamAbdelRahman, leveldb, andrewkr, dhruba Differential Revision: https://reviews.facebook.net/D61137 --- tools/db_stress.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/db_stress.cc b/tools/db_stress.cc index ad1d71ebb..ceafe6b4a 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -920,11 +920,13 @@ class DbStressListener : public EventListener { assert(info.db_name == db_name_); assert(IsValidColumnFamilyName(info.cf_name)); VerifyFilePath(info.file_path); - assert(info.file_size > 0); assert(info.job_id > 0 || FLAGS_compact_files_one_in > 0); - assert(info.table_properties.data_size > 0); - assert(info.table_properties.raw_key_size > 0); - assert(info.table_properties.num_entries > 0); + if (info.status.ok()) { + assert(info.file_size > 0); + assert(info.table_properties.data_size > 0); + assert(info.table_properties.raw_key_size > 0); + assert(info.table_properties.num_entries > 0); + } } protected: -- GitLab