10000 BugFix 3.3: adjust SetThrottle() to only call GetDelayToken() first … · odidev/arangodb@225095d · GitHub
[go: up one dir, main page]

Skip to content

Commit 225095d

Browse files
matthewvonneunhoef
authored andcommitted
BugFix 3.3: adjust SetThrottle() to only call GetDelayToken() first time. (arangodb#5854)
* adjust SetThrottle() to only call GetDelayToken() first time. Each call disrupts throttle timing. * add ChangeLog entry
1 parent 7a058a5 commit 225095d

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

CHANGELOG

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
v3.3.12 (2018-07-12)
22
--------------------
33

4+
* PR5854: rocksdb engine would frequently request a new DelayToken. This caused
5+
excessive write delay on the next Put() call. Alternate approach taken.
6+
47
* fixed graph creation under some circumstances failing with 'edge collection
58
already used in edge def' despite the edge definitions being identical
69

@@ -45,7 +48,7 @@ v3.3.11 (2018-06-26)
4548
more than a single shard and using a custom shard key (i.e. some shard
4649
key attribute other than `_key`).
4750
The previous implementation of DOCUMENT restricted to lookup to a single
48-
shard in all cases, though this restriction was invalid. That lead to
51+
shard in all cases, though this restriction was invalid. That lead to
4952
`DOCUMENT` not finding documents in cases the wrong shard was contacted. The
5053
fixed implementation in 3.3.11 will reach out to all shards to find the
5154
document, meaning it will produce the correct result, but will cause more
@@ -59,7 +62,7 @@ v3.3.11 (2018-06-26)
5962

6063
* fixed internal issue #2256: ui, document id not showing up when deleting a document
6164

62-
* fixed internal issue #2163: wrong labels within foxx validation of service
65+
* fixed internal issue #2163: wrong labels within foxx validation of service
6366
input parameters
6467

6568
* fixed internal issue #2160: fixed misplaced tooltips in indices view
@@ -235,7 +238,7 @@ v3.3.9 (2018-05-17)
235238
`COLLECT ...` (no options) => create a plan using sorted, and another plan using hash method
236239

237240
* added bulk document lookups for MMFiles engine, which will improve the performance
238-
of document lookups from an inside an index in case the index lookup produces many
241+
of document lookups from an inside an index in case the index lookup produces many
239242
documents
240243

241244

arangod/RocksDBEngine/RocksDBThrottle.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,24 @@ void RocksDBThrottle::SetThrottle() {
440440
// hard casting away of "const" ...
441441
if (((WriteController&)_internalRocksDB->write_controller()).max_delayed_write_rate() < _throttleBps) {
442442
((WriteController&)_internalRocksDB->write_controller()).set_max_delayed_write_rate(_throttleBps);
443-
} //if
444-
_delayToken=(((WriteController&)_internalRocksDB->write_controller()).GetDelayToken(_throttleBps));
443+
} // if
444+
445+
// Only replace the token when absolutely necessary. GetDelayToken()
446+
// also resets internal timers which can result in long pauses if
447+
// flushes/compactions are happening often.
448+
if (nullptr == _delayToken.get()) {
449+
_delayToken=(((WriteController&)_internalRocksDB->write_controller()).GetDelayToken(_throttleBps));
450+
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
451+
<< "SetThrottle(): GetDelayTokey(" << _throttleBps << ")";
452+
} else {
453+
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
454+
<< "SetThrottle(): set_delayed_write_rate(" << _throttleBps << ")";
455+
((WriteController&)_internalRocksDB->write_controller()).set_delayed_write_rate(_throttleBps);
456+
} // else
445457
} else {
446458
_delayToken.reset();
459+
LOG_TOPIC(DEBUG, arangodb::Logger::ENGINES)
460+
<< "SetThrottle(): _delaytoken.reset()";
447461
} // else
448462
} // if
449463
} // lock

0 commit comments

Comments
 (0)
0