-
Notifications
You must be signed in to change notification settings - Fork 816
Faster rolling upgrades. #325
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
Conversation
f06ac7b
to
2c1a25c
Compare
cortex.proto
Outdated
// Claim allows leaving ingester to stream chunks directly to joining ingesters. | ||
rpc ClaimStart(ClaimStartRequest) returns (ClaimStartResponse) {}; | ||
rpc ClaimStream(stream TimeSeriesChunk) returns (ClaimStreamResponse) {}; | ||
rpc ClaimFinish(ClaimFinishRequest) returns (ClaimFinishResponse) {}; |
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.
Rename to Transfer{StartStreamFinish}
?
Also, can the {Start,Finish}
methods be avoided?
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.
Done.
ingester/ingester_claim.go
Outdated
return &cortex.ClaimFinishResponse{}, nil | ||
} | ||
|
||
func toWireChunks(descs []*desc) ([]cortex.Chunk, 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.
Move to util/compat.go
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.
Nah, uses the ingester/desc type which I want to keep internal.
4f81de5
to
587f34a
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.
Thanks. Really cool. There are enough changes & comments that I won't LGTM, but I don't anticipate problems.
cortex.proto
Outdated
@@ -13,6 +13,9 @@ service Ingester { | |||
rpc LabelValues(LabelValuesRequest) returns (LabelValuesResponse) {}; | |||
rpc UserStats(UserStatsRequest) returns (UserStatsResponse) {}; | |||
rpc MetricsForLabelMatchers(MetricsForLabelMatchersRequest) returns (MetricsForLabelMatchersResponse) {}; | |||
|
|||
// TransferChunks allows leaving ingester to stream chunks directly to joining ingesters. |
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.
Say which of the two is supposed to call this.
distributor/distributor.go
Outdated
@@ -88,7 +80,7 @@ type Config struct { | |||
IngestionBurstSize int | |||
|
|||
// for testing | |||
ingesterClientFactory func(string) cortex.IngesterClient | |||
ingesterClientFactory func(string, time.Duration) (cortex.IngesterClient, 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.
Please update comment say what string
and time.Duration
represent
ingester/ingester.go
Outdated
ringConfig ring.Config | ||
userStatesConfig UserStatesConfig | ||
|
||
// Config for the ingester lifecycle contol |
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.
"control"
ingester/ingester.go
Outdated
ChunkEncoding string | ||
|
||
// For testing | ||
Addr string |
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.
Addr of what?
ingester/ingester.go
Outdated
userStatesConfig UserStatesConfig | ||
|
||
// Config for the ingester lifecycle contol | ||
ListenPort *int |
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.
Why is this a pointer?
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.
Its shared with the server config - see https://github.com/weaveworks/cortex/blob/master/cmd/ingester/main.go#L33
ring/model.go
Outdated
@@ -56,3 +58,39 @@ func (d *Desc) removeIngester(id string) { | |||
} | |||
d.Tokens = output | |||
} | |||
|
|||
// ClaimTokens transfters all the tokens from one ingester to another. |
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.
"returning the claimed tokens"
ring/model.go
Outdated
return result | ||
} | ||
|
||
// FindIngestersByState returns the list of ingesterd in the given state |
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.
ingesters
ingester/util.go
Outdated
func (ts sortableUint32) Less(i, j int) bool { return ts[i] < ts[j] } | ||
|
||
// getFirstAddressOf returns the first IPv4 address of the supplied interface name. | ||
func getFirstAddressOf(name string) (string, 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.
Please remove the implementation that's in alertmanager.
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.
They do different things - alertmangers gets the first non-empty address, this gets the address for a given interface. I'll file a ticket to reconcile them later.
ingester/ingester_lifecycle_test.go
Outdated
ingester, err := New(config, nil) | ||
if err != nil { | ||
t.Fatal(err) | ||
} |
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.
Can we use testify, so we can spelling this require.NoError(err)
?
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.
Thanks! If you're really keen, you can also import assert
from testify and use its Equal
function to replace some of the DeepEqual
business.
ingester/ingester_lifecycle_test.go
Outdated
} | ||
} | ||
|
||
func TestIngesterRestart(t *testing.T) { |
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.
What about restart are we testing? (Please add comment)
8113f83
to
b14c4a5
Compare
ingester/ingester_claim.go
Outdated
|
||
// We can't send "extra" fields with a streaming call, so we repeat | ||
// wireSeries.FromIngesterId and assume it is the same every time | ||
// tound this loop. |
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.
"round"
ingester/ingester_lifecycle.go
Outdated
return i.ready | ||
} | ||
|
||
// ChangeState of the ingester, for use off the loop() goroutine. |
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.
FWIW, "by" or "from" are probably better than the "off of the", but it's such an incredibly minor point.
I missed this. Sorry, I don't have a better suggestion. No strong
objections to `c` but don't think it's a huge improvement either. No big
deal.
…On Mon, 13 Mar 2017 at 11:34 Tom Wilkie ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In ingester/ingester_lifecycle.go
<#325 (comment)>:
> + }
+
+ ringDesc, err := i.consul.Get(ring.ConsulKey)
+ if err != nil {
+ log.Error("Error talking to consul: %v", err)
+ return false
+ }
+
+ i.ready = i.ready || ringDesc.(*ring.Desc).Ready(i.cfg.ringConfig.HeartbeatTimeout)
+ return i.ready
+}
+
+// ChangeState of the ingester, for use off the loop() goroutine.
+func (i *Ingester) ChangeState(state ring.IngesterState) error {
+ err := make(chan error)
+ i.actorChan <- func() {
better suggestion? c?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#325 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAHq6kpNP4rQyYFxmDpvUgURwNKKvlyGks5rlSmzgaJpZM4MYGwP>
.
|
Fixes #321
It works! And its quick...
TODO
ensure ingester flushing stops before transferring chunks- shouldn't do this, as we don't want chunks that won't flush to block the transfer.add an ever-extending timeout on the receiving ingester, when we do timeout auto-join- going to leave this for now, can always kill ingesters if they get stuck, will fall back to flushing.