[chef] Re: Simultaneous node edits


Chronological Thread 
  • From: Noah Kantrowitz < >
  • To:
  • Subject: [chef] Re: Simultaneous node edits
  • Date: Wed, 1 Jul 2015 12:27:50 -0700


On Jul 1, 2015, at 12:23 PM, Daniil S 
< >
 wrote:

> Hello.
> 
> I'd like to know how people avoid collisions, while two simultaneous node 
> edits take place. Some very common (and painful) examples from my practice:
> 1. Two sysadmins +/- simultaneously issue 'knife node edit' on the same 
> node. First of them who save edits will lost them because of the save of 
> the second admin;
> 2. Person for sure lost his edits if he try to 'knife node edit' while chef 
> client runs on this node. And you can't predict it even if you are single 
> person who can manage nodes because chef may run as a daemon or via cron.

The Chef API is full of these race conditions. Generally the best approach is 
to not use `knife node edit` and when you need to do some kind of bulk 
update, have a "talking stick" negotiated out of band (usually in a chat 
room). For non-node objects this is "fixed" because the authoritative source 
of truth is source control and the second user would get a merge conflict.

Node data should be set once at bootstrap and then never changed. If you need 
to bring up a new node, do that instead.

--Noah

Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail




Archive powered by MHonArc 2.6.16.

§