-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Implement the dual mode for Thanos Receiver #4231
Conversation
7f5c0a2
to
f21f32a
Compare
Hi @squat ! I have added an e2e test scenario about creating 3 ingestor(hashrings contain only the local endpoint) and 1 distributor. Can you check if the logic for the same is implemented correctly? I ran the tests, and cross-checked if the behaviour is correct, but would be nice to have your opinion as well 💯 |
cmd/thanos/receive.go
Outdated
port := parts[len(parts)-1] | ||
*localEndpoint = net.JoinHostPort(hostname, port) | ||
} | ||
// if *localEndpoint == "" { |
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.
Do you want me to uncomment this part? However, we might not be able to support the distributor mode, as the localEndpoint
would always have a non-nil value.
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 should remove this if it's not used.
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.
Yup, this is a breaking change, so lets make a note for this
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.
This is looking however it gives me an unsettling feeling. It's really hard to follow up on changes and modes.
Could we try to encapsulate logic into functions to increase readability?
I know this was an existing issue but this is a chance to improve the control flow.
Can you link the issue? |
Tracking issue - #2248 |
f75150b
to
15cc6f8
Compare
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.
This is on a good path. Thanks a lot @yashrsharma44.
I have added comments inline.
grpcProbe *prober.GRPCProbe, | ||
|
||
) error { | ||
g.Add(func() error { |
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.
This looks it does the job. I'd prefer keeping the run.Group
in the top-level function and extract whatever we pass to g.Add
on a different function.
Signed-off-by: Yash Sharma <[email protected]> remove flag for ingestion mode, and decide internally Signed-off-by: Yash Sharma <[email protected]> moved grpc setup for both ingestion and distribution Signed-off-by: Yash Sharma <[email protected]> added an e2e test Signed-off-by: Yash Sharma <[email protected]> move dbs and writer outside scope Signed-off-by: Yash Sharma <[email protected]> test remove stray at /handler 467 Signed-off-by: Yash Sharma <[email protected]> fixed a duplicate code in receiver.go Signed-off-by: Yash Sharma <[email protected]> removed stray line in handler Signed-off-by: Yash Sharma <[email protected]> added a e2e test for ingestion and distributor scenario Signed-off-by: Yash Sharma <[email protected]> uncommented other tests Signed-off-by: Yash Sharma <[email protected]> restored receiver to main branch implementation Signed-off-by: Yash Sharma <[email protected]> break down multiple logical parts of receiver into functions Signed-off-by: Yash Sharma <[email protected]>
15cc6f8
to
29870d8
Compare
Signed-off-by: Yash Sharma <[email protected]>
Signed-off-by: Yash Sharma <[email protected]>
b363cc0
to
939748e
Compare
Signed-off-by: Yash Sharma <[email protected]>
939748e
to
a12006c
Compare
Signed-off-by: Yash Sharma <[email protected]>
Signed-off-by: Yash Sharma <[email protected]>
d55a0aa
to
b635613
Compare
I might set up this branch and play with the benchmarks using this PR - thanos-io/thanosbench#34 So will report the statistics and benchmarks, once I run them up 😎 |
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.
Overall looks great to me! I think the PR is a lot simpler now without the extra concepts of the different "modes" :))
Co-authored-by: Lucas Servén Marín <[email protected]> Update cmd/thanos/receive.go Co-authored-by: Lucas Servén Marín <[email protected]> Signed-off-by: Yash Sharma <[email protected]>
61b7497
to
ab9efaa
Compare
Signed-off-by: Yash Sharma <[email protected]>
ab9efaa
to
36866ab
Compare
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.
🥇 🚀
Implementation PR for the Thanos Split Receiver proposal - https://thanos.io/tip/proposals/202012_receive_split.md/
PR is incomplete, pushed for tracking changes and quick review
TODO:
Signed-off-by: Yash Sharma [email protected]