diff --git a/utilities/backupable/backupable_db_test.cc b/utilities/backupable/backupable_db_test.cc index c5909f8e7..89326bfe7 100644 --- a/utilities/backupable/backupable_db_test.cc +++ b/utilities/backupable/backupable_db_test.cc @@ -250,17 +250,15 @@ class FileManager : public EnvWrapper { return s; } - std::vector positions; - auto pos = metadata.find(" crc32 "); + auto pos = metadata.find("private"); + if (pos == std::string::npos) { + return Status::Corruption("private file is expected"); + } + pos = metadata.find(" crc32 ", pos + 6); if (pos == std::string::npos) { return Status::Corruption("checksum not found"); } - do { - positions.push_back(pos); - pos = metadata.find(" crc32 ", pos + 6); - } while (pos != std::string::npos); - pos = positions[rnd_.Next() % positions.size()]; if (metadata.size() < pos + 7) { return Status::Corruption("bad CRC32 checksum value"); }