-
Notifications
You must be signed in to change notification settings - Fork 17
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
WIP: Consistent hashing for balancer #258
Open
TheRandomCharacter
wants to merge
27
commits into
yanet-platform:main
Choose a base branch
from
TheRandomCharacter:chash
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
70cbd79
wlc mowed to from dataplane to controlplane
levon-a-akopian 59e9b3e
Refactors service evaluation
b98de20
Adds chash service evaluation stub
95e01ce
Adds handling of chash services to dataplane
e5ae4d4
Works. Maybe
bfa8e0f
Adds chash submodule
69fbfa9
Updates chash
cb856e7
Fixes build
ad4c864
Updates chash
7d8b42d
Changes chash submodule to track master
c07d5a7
Update chash
f613799
Disables unittests in chash subproject
61a6aa8
Fixes build
3b6dfc7
Fixes ubuntu 18 includes
df6aeb4
Updates chash submodule
0cf7590
Switches default meson option to link statically
7089d5a
No config params
4f3e395
Updates chash fixing edge cases
5122d78
Fixes wlc using chash
a5ee74f
Adds feedback on autotests errors
7259efa
Updates autotest 055_balancer_wlc expected data
cd20fd0
Replaces goto with deferer object
ed5a090
Changes autotest
db3d789
Constants
20297e6
Some stylefix
9eb04b3
References
92d2254
Reserves
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
namespace utils | ||
{ | ||
|
||
template<typename F> | ||
class Deferer | ||
{ | ||
F action_; | ||
|
||
public: | ||
Deferer(F&& action) : | ||
action_{std::move(action)} | ||
{} | ||
Deferer(const Deferer& other) = delete; | ||
Deferer(Deferer&& other) = delete; | ||
Deferer& operator=(const Deferer& other) = delete; | ||
Deferer& operator=(Deferer&& other) = delete; | ||
~Deferer() | ||
{ | ||
action_(); | ||
} | ||
}; | ||
|
||
} // namespace utils |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this makes code unnecessary complex. Maybe with more complex logic it will be fine, but here I feel like just doing
is sufficient enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to
YADECAP_MEMORY_BARRIER_COMPILE
at each function exit path. Using it at each existing function exit doesn't convey this intent to future function changes.How about using a
DEFERED_MEMORY_BARRIER_COMPILE
macro?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, maybe your solution makes more sense that I've thought initially.
smth like this will suffice?
And do that at the start of every method: