Skip to content

Commit 64ee3a6

Browse files
committed
Revert "feat:测试魔改代码"
1 parent db019e1 commit 64ee3a6

1 file changed

Lines changed: 0 additions & 17 deletions

File tree

src/storage/src/redis.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,32 +198,15 @@ Status Redis::SetMaxCacheStatisticKeys(size_t max_cache_statistic_keys) {
198198
/*
199199
* compactrange no longer supports compact for a single data type
200200
*
201-
* 魔改版本:添加延迟放大并发竞争窗口,用于复现 SST 损坏问题
202-
* 注意:此修改仅用于测试环境,生产环境请勿使用
203201
*/
204202
Status Redis::CompactRange(const rocksdb::Slice* begin, const rocksdb::Slice* end) {
205-
// 随机延迟 0-50ms,让 7 个 CF 的启动时间错开但仍重叠
206-
std::this_thread::sleep_for(std::chrono::milliseconds(rand() % 50));
207203

208204
db_->CompactRange(default_compact_range_options_, begin, end);
209-
210-
// 每个 CF 之间固定延迟 20ms,增加并发重叠度
211-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
212205
db_->CompactRange(default_compact_range_options_, handles_[kHashesDataCF], begin, end);
213-
214-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
215206
db_->CompactRange(default_compact_range_options_, handles_[kSetsDataCF], begin, end);
216-
217-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
218207
db_->CompactRange(default_compact_range_options_, handles_[kListsDataCF], begin, end);
219-
220-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
221208
db_->CompactRange(default_compact_range_options_, handles_[kZsetsDataCF], begin, end);
222-
223-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
224209
db_->CompactRange(default_compact_range_options_, handles_[kZsetsScoreCF], begin, end);
225-
226-
std::this_thread::sleep_for(std::chrono::milliseconds(20));
227210
db_->CompactRange(default_compact_range_options_, handles_[kStreamsDataCF], begin, end);
228211

229212
return Status::OK();

0 commit comments

Comments
 (0)