rocksdb/file
Changyu Bi b800b5eb6a Deflake ThreadStatus related unit tests (#12858)
Summary:
Unit tests `DBTest.ThreadStatusFlush` and `DBTestWithParam.ThreadStatusSingleCompaction` have been flaky and fail with error message
```
[ RUN      ] DBTest.ThreadStatusFlush
op_count: 0, expected_count 1
thread id: 718113, thread status: , cf_name
thread id: 718114, thread status: , cf_name pikachu
/__w/rocksdb/rocksdb/db/db_test.cc:4817: Failure
Value of: VerifyOperationCount(env_, ThreadStatus::OP_FLUSH, 1)
  Actual: false
Expected: true
[  FAILED  ] DBTest.ThreadStatusFlush (106 ms)

[ RUN      ] DBTestWithParam/DBTestWithParam.ThreadStatusSingleCompaction/0
db/db_test.cc:4673: Failure
Expected equality of these values:
  op_count
    Which is: 0
  expected_count
    Which is: 1
[  FAILED  ] DBTestWithParam/DBTestWithParam.ThreadStatusSingleCompaction/0, where GetParam() = (1, false)
```

One cause for this is that before flush/compaction finishes, we will go through `~WritableFileWriter()`, either for WAL or SST file, and temporarily set thread_operation to UNKNOWN. This UNKNOWN thread operation seem to be there for some stress test verification. This PR fixes these tests by setting the IOActivity in ~WritableFileWriter() for debug build.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/12858

Test Plan: monitor future test failure.

Reviewed By: hx235

Differential Revision: D59691564

Pulled By: cbi42

fbshipit-source-id: 3f96998bba9d42aba50d1830c2b51bef2dd6705f
2024-07-15 09:56:09 -07:00
..
delete_scheduler.cc Fix delete obsolete files on recovery not rate limited (#12590) 2024-05-01 12:26:54 -07:00
delete_scheduler.h
delete_scheduler_test.cc
file_prefetch_buffer.cc
file_prefetch_buffer.h
file_util.cc Fix Checkpoint hard link of inactive but unsynced WAL (#12731) 2024-06-05 17:40:09 -07:00
file_util.h Fix delete obsolete files on recovery not rate limited (#12590) 2024-05-01 12:26:54 -07:00
filename.cc
filename.h
line_file_reader.cc
line_file_reader.h
prefetch_test.cc Respect ReadOptions::read_tier in prefetching (#12782) 2024-06-19 09:53:59 -07:00
random_access_file_reader.cc
random_access_file_reader.h
random_access_file_reader_test.cc
read_write_util.cc
read_write_util.h
readahead_file_info.h
readahead_raf.cc
readahead_raf.h
sequence_file_reader.cc
sequence_file_reader.h
sst_file_manager_impl.cc
sst_file_manager_impl.h Fix delete obsolete files on recovery not rate limited (#12590) 2024-05-01 12:26:54 -07:00
writable_file_writer.cc Inject more errors to more files in stress test (#12713) 2024-06-19 08:42:00 -07:00
writable_file_writer.h Deflake ThreadStatus related unit tests (#12858) 2024-07-15 09:56:09 -07:00