You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2020/11/23 03:46:19 UTC

[GitHub] [incubator-pegasus] Smityz commented on a change in pull request #632: fix(hotkey): fix two hidden dangers in hotkey_collector

Smityz commented on a change in pull request #632:
URL: https://github.com/apache/incubator-pegasus/pull/632#discussion_r528459562



##########
File path: src/server/hotkey_collector.cpp
##########
@@ -145,19 +202,24 @@ void hotkey_collector::capture_raw_key(const dsn::blob &raw_key, int64_t weight)
 void hotkey_collector::capture_hash_key(const dsn::blob &hash_key, int64_t weight)
 {
     // TODO: (Tangyanzhao) add a unit test to ensure data integrity
-    _internal_collector->capture_data(hash_key, weight);
+    switch (_state.load()) {
+    case hotkey_collector_state::COARSE_DETECTING:
+    case hotkey_collector_state::FINE_DETECTING:
+        _internal_coarse_collector->capture_data(hash_key, weight > 0 ? weight : 1);

Review comment:
       fiexd




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org