Skip to content

Conversation

@hanish520
Copy link
Contributor

No description provided.

@hanish520 hanish520 requested a review from meling January 19, 2025 02:36
hanish520 and others added 2 commits January 20, 2025 12:53
This just moves the latency methods out of the main tree.go file
and into treelatency.go to keep them separate. Similarly, this also
renames the corresponding test file to treelatency_test.go.
It is best to keep the enum in the same place as the selection
function. I've updated the test, but not the kauri impl.
This probably better reflects its intended meaning.
hanish520 and others added 7 commits January 24, 2025 00:30
This just renames things to be more consistent and trying to reflect
better the idea each entity represents.
Just reorganizing the layout of the file to keep TreeConfig away
from the Options methods.
This avoids keeping treeConfig in the struct; instead we keep the
actual treeWaitDelta and treeDelayType in the struct. We get these
from the k.opts.TreeConfig() in the initializationConfiguration()
method.
We don't create a lot of trees and passing it as a value should be
fine.
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
meling and others added 7 commits January 24, 2025 16:28
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
Co-authored-by: Leander Jehl <leander.jehl@uis.no>
If you need a different tree, you should create a new one.
The treeLeader module used the TreePos slice to pick the leader
based on the 0 index; this is not ideal, but I also wanted to
get rid of the TreeConfig struct, so this serves dual purpose.
This adds a waitTime field to the Tree struct, and two setters to
set it based on different computations; the following two are
supported: SetAggregationWaitTime and SetTreeHeightWaitTime.
Thus, we can now read it back out in the Kauri module without
providing the latency matrix, delta and delay type.
This refactors several aspects to prepare for supporting configurable
DelayTypes for trees; we currently support:

  // DelayType is the type of delay to use for the wait time.
  oneof DelayType {
    // AggregationTime computes the wait time based on the latency of links in the tree.
    bool AggregationTime = 26;
    // TreeHeightTime computes the wait time only based on the height of the tree.
    bool TreeHeightTime = 27;
  }

This refactoring involves:
- Removed func (srv *Server) LatencyMatrix() latency.Matrix
  since we no longer compute the wait time in the Kauri module.
- Create the tree and initialize the wait time based on the
  configured delay type (see above); we currently set the default
  to TreeHeightTime. This is done in worker.go.
- Added two helpers: func (x *ReplicaOpts) SetAggregationWaitTime()
  and func (x *ReplicaOpts) SetTreeHeightWaitTime()
- Kauri now only needs to store the tree.Tree in its struct; I've
  removed the treeWaitDelta and treeDelayType. This is since we
  create the tree in worker.go, we only need to get the tree from
  the opts, instead of the TreeConfig.
- Similarly, in the Kauri module we only need to read the wait time
  directly from the tree instance, using the WaitTime() method.
- Removed TreeConfig struct and associated methods from modules/options.go
  since we no longer use those to create a tree and compute the
  wait time in the Kauri module.
@meling meling merged commit 461e32c into master Jan 25, 2025
4 checks passed
@meling meling deleted the kauri-agg branch January 25, 2025 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants