Archimedes Trajano
Archimedes Trajano

Reputation: 41300

Does Kubernetes suffer from the "update out of sequence" errors that Docker Swarm randomly gets when there's several deployments running?

I find that when I do scheduled docker stack deployments and they happen around the same time I may get an "update out of sequence" error in a deployment.

I've seen many bugs and issues on this

Some of them are closed, but the problem apparently still persists to this day for some people. I was wondering if Kubernetes has solved this issue so it does not happen on K8S clusters.

Upvotes: 1

Views: 283

Answers (1)

Matt
Matt

Reputation: 74690

I wouldn't say the general issue is "solved" in Kubernetes as any shared system updating data can have synchronisation issues. You won't run into the issue often with the kubernetes primitives though.

That is until you start using complex, external Kubernetes API clients. Another area might be controllers competing with you to make updates (e.g the horizontal auto scaler setting replicas).

Update example

All kubernetes resources have a "resource version" in their metadata and it's possible for that data to be updated out of band with another change. This generally happens when data needs to be retrieved and inspected for an update to be made:

  1. A retrieves val
  2. A increments val
  3. B retrieves val
  4. B increments val
  5. A applies val, resourceVersion increments
  6. B applies val, resourceVersion mismatch, fails.

You could also add "C" into the mix. "C" isn't a very responsible shared api client (Bad C!). When applying it's val change, C doesn't supply a resourceVersion on it's update and silently blats any updates that were made since it retrieved val.

You will find that most kubernetes resources can be managed declaratively. So by applying PATCHes to an existing resources atomically on the kube apiserver (that atomicity is for a single resource).

Upvotes: 2

Related Questions