cmu-db / bustub

The BusTub Relational Database Management System (Educational)
https://15445.courses.cs.cmu.edu/
MIT License
3.92k stars 1.76k forks source link

bug: Wrong functionality exposed in DiskManagerUnlimitedMemory::EnableLatencySimulator #689

Open 4ever-xxxl opened 7 months ago

4ever-xxxl commented 7 months ago
  void EnableLatencySimulator(bool enabled) { latency_simulator_enabled_ = enabled; }

The function should only allow false values ​​to be set to true, and should be judged externally. Otherwise we can call this function to cancel the delay to cheat in Project 1 LeaderBoard(2023 fall). Here is an example:

        auto *disk_manager_memory = dynamic_cast<DiskManagerUnlimitedMemory *>(disk_manager_);
        if (disk_manager_memory != nullptr) {
          disk_manager_memory->EnableLatencySimulator(false);
        }