Skip to content

Commit

Permalink
Improve distributor rollouts (#604)
Browse files Browse the repository at this point in the history
* sleep an hour

Signed-off-by: Joe Elliott <number101010@gmail.com>

* are we stopping shims

Signed-off-by: Joe Elliott <number101010@gmail.com>

* sleep for 30 seconds

Signed-off-by: Joe Elliott <number101010@gmail.com>

* 30 second sleeps everywhere

Signed-off-by: Joe Elliott <number101010@gmail.com>

* only sleep for 30 seconds once

Signed-off-by: Joe Elliott <number101010@gmail.com>

* added termination grace period

Signed-off-by: Joe Elliott <number101010@gmail.com>

* Slow roll it

Signed-off-by: Joe Elliott <number101010@gmail.com>

* undo change

Signed-off-by: Joe Elliott <number101010@gmail.com>
  • Loading branch information
joe-elliott authored Mar 21, 2021
1 parent c4d9771 commit fd40d74
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions modules/distributor/receiver/shim.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ func (r *receiversShim) starting(ctx context.Context) error {

// Called after distributor is asked to stop via StopAsync.
func (r *receiversShim) stopping(_ error) error {
// when shutdown is called on the receiver it immediately shuts down its connection
// which drops requests on the floor. at this point in the shutdown process
// the readiness handler is already down so we are not receiving any more requests.
// sleep for 30 seconds to here to all pending requests to finish.
time.Sleep(30 * time.Second)

ctx, cancelFn := context.WithTimeout(context.Background(), 30*time.Second)
defer cancelFn()

Expand Down
3 changes: 3 additions & 0 deletions operations/jsonnet/microservices/distributor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
app: target_name,
[$._config.gossip_member_label]: 'true',
}) +
deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge(0) +
deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable(1) +
deployment.mixin.spec.template.spec.withTerminationGracePeriodSeconds(60) +
deployment.mixin.spec.template.metadata.withAnnotations({
config_hash: std.md5(std.toString($.tempo_configmap.data['tempo.yaml'])),
}) +
Expand Down

0 comments on commit fd40d74

Please sign in to comment.