8000 BugFix 3.3: adjust SetThrottle() to only call GetDelayToken() first time. by matthewvon · Pull Request #5854 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

BugFix 3.3: adjust SetThrottle() to only call GetDelayToken() first time. #5854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 12, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
adjust SetThrottle() to only call GetDelayToken() first time. Each ca…
…ll disrupts throttle timing.
  • Loading branch information
matthewvon committed Jul 12, 2018
commit 6031e4cf4e0b242b13141c05b55865ef2ea3bb5c
18 changes: 16 additions & 2 deletions arangod/RocksDBEngine/RocksDBThrottle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,10 +440,24 @@ void RocksDBThrottle::SetThrottle() {
// hard casting away of "const" ...
if (((WriteController&)_internalRocksDB->write_controller()).max_delayed_write_rate() < _throttleBps) {
((WriteController&)_internalRocksDB->write_controller()).set_max_delayed_write_rate(_throttleBps);
} //if
_delayToken=(((WriteController&)_internalRocksDB->write_controller()).GetDelayToken(_throttleBps));
} // if

// Only replace the token when absolutely necessary. GetDelayToken()
// also resets internal timers which can result in long pauses if
// flushes/compactions are happening often.
if (nullptr == _delayToken.get()) {
_delayToken=(((WriteController&)_internalRocksDB->write_controller()).GetDelayToken(_throttleBps));
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
<< "SetThrottle(): GetDelayTokey(" << _throttleBps << ")";
} else {
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
<< "SetThrottle(): set_delayed_write_rate(" << _throttleBps << ")";
((WriteController&)_internalRocksDB->write_controller()).set_delayed_write_rate(_throttleBps);
} // else
} else {
_delayToken.reset();
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
<< "SetThrottle(): _delaytoken.reset()";
} // else
} // if
} // lock
Expand Down
0