Page MenuHomePhabricator

[avalanche] Add a penalty to the availability score for the nodes we don't poll
AbandonedPublic

Authored by Fabien on Aug 11 2021, 12:32.

Details

Reviewers
deadalnix
Group Reviewers
Restricted Project
Maniphest Tasks
Restricted Maniphest Task
Summary

The node activity score is computed as 2 * votes - polls, with an exponential smoothing. It starts at 0, and is updated every 10 minutes. After 10 minutes there are 3 possible cases:

  1. it turns > 0 if the node voted when we polled it
  2. it turns < 0 if the node did not vote when we polled it
  3. it remains 0 if we did not poll the node

This behavior can be problematic when deciding whether a node can be evicted or not: if the score of a node is 0, we don't know if it was never selected for polling (case 3) or if the score was not computed yet (before 10 minutes elapsed). If the node was never selected for polling, this means this is not an interesting node to protect from eviction. On the other hand, a node that did not get its score computed might be an interesting one, we just don't know yet.

This diff adds a negative penalty to the score, which causes the case 3 to turn into a negative score as well. By doing that we can easily decide if a node is worth being protected from eviction: a node with a strictly negative score is not worth it.

Depends on D9858. Supersedes D9862.

Ref T1634.

Test Plan
ninja all check-all

Diff Detail

Event Timeline

Fabien requested review of this revision.Aug 11 2021, 12:33
deadalnix requested changes to this revision.Aug 11 2021, 18:42
deadalnix added a subscriber: deadalnix.

I don't understand what problem this is solving. The description isn't describing a problem that this solves. I'm no convinced this is needed at all.

This revision now requires changes to proceed.Aug 11 2021, 18:42

I updated the summary to better explain the problem it solves. Note that this is an optimization and not something mandatory for the eviction to work properly.

Fabien requested review of this revision.Aug 12 2021, 09:34

I still don't see what problem it solves. This whole thing's purpose is *to protect good nodes from eviction* . From that perspective, nodes for which we don't know and nodes which have a bad track record don't really differ: if they aren't good node, there is no point protecting them.

deadalnix requested changes to this revision.Aug 12 2021, 11:21
This revision now requires changes to proceed.Aug 12 2021, 11:21