Fix db_stress assertion failures on 0 byte SSTs (#4273)

Summary:
In the OnTableFileCreation() listener, assert on various TableProperties
only when file size > 0 bytes. The listener can get called even for 0
byte SSTs which have been deleted.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4273

Differential Revision: D9322738

Pulled By: anand1976

fbshipit-source-id: 17cdfb3d0da946b9a158d7328e5db1c87973956b
main
Anand Ananthabhotla 6 years ago committed by Facebook Github Bot
parent d122025891
commit bf07e90cf2
  1. 2
      tools/db_stress.cc

@ -1251,7 +1251,7 @@ class DbStressListener : public EventListener {
assert(IsValidColumnFamilyName(info.cf_name)); assert(IsValidColumnFamilyName(info.cf_name));
VerifyFilePath(info.file_path); VerifyFilePath(info.file_path);
assert(info.job_id > 0 || FLAGS_compact_files_one_in > 0); assert(info.job_id > 0 || FLAGS_compact_files_one_in > 0);
if (info.status.ok()) { if (info.status.ok() && info.file_size > 0) {
assert(info.table_properties.data_size > 0); assert(info.table_properties.data_size > 0);
assert(info.table_properties.raw_key_size > 0); assert(info.table_properties.raw_key_size > 0);
assert(info.table_properties.num_entries > 0); assert(info.table_properties.num_entries > 0);

Loading…
Cancel
Save