From fc237fe4be42e7855f1aaceb691ff2dedf26c589 Mon Sep 17 00:00:00 2001 From: Alex Dadgar Date: Mon, 7 Nov 2016 16:52:08 -0800 Subject: [PATCH] Add compatibility code for secret ID while upgrading cluster in both server/client mode on single nodes --- client/client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/client/client.go b/client/client.go index 5f34ec699..543d21f9c 100644 --- a/client/client.go +++ b/client/client.go @@ -1185,7 +1185,13 @@ func (c *Client) watchAllocations(updates chan *allocUpdates) { default: } - if err != noServersErr { + // COMPAT: Remove in 0.6. This is to allow the case in which the + // servers are not fully upgraded before the clients register. This + // can cause the SecretID to be lost + if strings.Contains(err.Error(), "node secret ID does not match") { + c.logger.Printf("[DEBUG] client: re-registering node as there was a secret ID mismatch: %v", err) + c.retryRegisterNode() + } else if err != noServersErr { c.logger.Printf("[ERR] client: failed to query for node allocations: %v", err) } retry := c.retryIntv(getAllocRetryIntv)