Skip to content
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

receive: use gRPC for forwarding messages #1970

Merged
merged 3 commits into from Jan 10, 2020

Conversation

blockloop
Copy link
Contributor

@blockloop blockloop commented Jan 8, 2020

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

Receive: use gRPC for forwarding messages between receive peers to significantly increase throughput. This also introduces the ability for users to use gRPC to write messages to Thanos via gRPC.

Verified

A working build can be run with this docker-compose configuration https://gist.github.com/blockloop/637bd0c8c9295178b67812f43e661419

The images used in that gist have been built from this branch. I have run it and verified that everything is working.

Here is a screenshot of Thanos query from that setup:

image

Fixes #1710

@blockloop blockloop force-pushed the bjones/receive/use-grpc branch 3 times, most recently from bdbc8d6 to e1153af Compare January 8, 2020 23:13
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super fast progress! I have some questions @blockloop

pkg/receive/writable_store.go Outdated Show resolved Hide resolved
pkg/store/storepb/rpc.proto Outdated Show resolved Hide resolved
pkg/store/storepb/rpc.proto Outdated Show resolved Hide resolved
// ReadWriteStoreServer is a StoreServer and a WriteableStoreServer.
type ReadWriteStoreServer interface {
storepb.StoreServer
storepb.WriteableStoreServer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am wondering again about exposing these on the same gRPC service. If we do, we have to make sure to document that exposing the receive gRPC to a WAN to enable writes means that one tenant could read any other tenant’s metrics

Copy link
Member

@GiedriusS GiedriusS Jan 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that's acceptable for now 🤔 we could change it in the future if needed.

@squat
Copy link
Member

squat commented Jan 9, 2020 via email

@blockloop blockloop force-pushed the bjones/receive/use-grpc branch 3 times, most recently from 4aa3200 to ea911f5 Compare January 9, 2020 17:42
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So awesome. We already hacked together a lot offline so most comments are already addressed. I have some v small requests and then 💯

pkg/receive/handler.go Show resolved Hide resolved
pkg/receive/handler.go Outdated Show resolved Hide resolved
pkg/receive/handler.go Outdated Show resolved Hide resolved
pkg/store/storepb/rpc.proto Outdated Show resolved Hide resolved
Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :))) lgtm on green

Copy link
Member

@GiedriusS GiedriusS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At a first glance LGTM. Could you rebase after the recent changes before the final review?

@blockloop blockloop force-pushed the bjones/receive/use-grpc branch 2 times, most recently from 5748a8a to 6709020 Compare January 9, 2020 23:53
@blockloop
Copy link
Contributor Author

Rebase complete @GiedriusS

Signed-off-by: Brett Jones <blockloop@users.noreply.github.com>
Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one small comment, otherwise this lgtm. Very incredibly fast turn around I have to say! Thank you so much! :)

CHANGELOG.md Outdated
@@ -14,6 +14,7 @@ We use *breaking* word for marking changes that are not backward compatible (rel
- [#1969](https://github.com/thanos-io/thanos/pull/1969) Sidecar: allow setting http connection pool size via flags
- [#1967](https://github.com/thanos-io/thanos/issues/1967) Receive: Allow local TSDB compaction
- [#1975](https://github.com/thanos-io/thanos/pull/1975) Store Gateway: fixed panic caused by memcached servers selector when there's 1 memcached node
- [#1970](https://github.com/thanos-io/thanos/issues/1970) Receive: Use gRPC for forwarding requests between peers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need an item here that indicates that people need to change their hashring files to be just addresses that the gRPC client is built from, instead of the full http endpoint.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
Copy link
Member

@brancz brancz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So awesome! Thanks! lgtm 👍

@brancz brancz merged commit 3cf366a into thanos-io:master Jan 10, 2020
squat added a commit to squat/thanos-receive-controller that referenced this pull request Jan 13, 2020
This commit updates the controller to generate gRPC endpoints rather
than HTTP endpoints, following
thanos-io/thanos#1970.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
squat added a commit to squat/thanos-receive-controller that referenced this pull request Jan 13, 2020
This commit updates the controller to generate gRPC endpoints rather
than HTTP endpoints, following
thanos-io/thanos#1970.

Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
@blockloop blockloop deleted the bjones/receive/use-grpc branch July 28, 2021 18:42
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.

receive: create a gRPC remote_write endpoint
4 participants