Skip to content

Commit

Permalink
Update comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
JinheLin committed Oct 11, 2022
1 parent 33c4d17 commit 0c375ca
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dbms/src/Encryption/RateLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,9 @@ IOLimitTuner::Watermark IOLimitTuner::getWatermark(const LimiterStatUPtr & fg, c
// 3. The usage rate of read is `(max_bg_read_bytes_per_sec + 0 ) / (max_bg_read_bytes_per_sec + max_fg_read_bytes_per_sec)`, about 50%.
// 4. 50% is less than `io_config.medium_pct`(60% by default), so watermark is `LOW`.
// 5. The `LOW` watermark means that bandwidth quota of read is sufficient since the usage rate is less than 60%, so it is unnessary to increase its bandwidth quota by decreasing the bandwidth quota of write.
// 6. In this case, `bg_read` will only try to increase its bandwidth quota by decreasing the bandwidth quota of `fg_read`.
// 6. `bg_read` will only try to increase its bandwidth quota by decreasing the bandwidth quota of `fg_read`.
// 7. However, `fg_read` is too small to decrease, so `bg_read` cannot be increased neither.
// 8. To avoid the bad case above, if the bandwidth quota we want to decrease is too small, returning the greater watermark and try to tune bandwidth between read and write.
if (fg != nullptr && bg != nullptr)
{
auto fg_wm = getWatermark(fg->pct());
Expand Down

0 comments on commit 0c375ca

Please sign in to comment.