[Pacemaker] racing crm commands... last write wins?

Lars Marowsky-Bree lmb at suse.com
Thu Feb 28 13:34:41 EST 2013


On 2013-02-28T17:51:03, Dejan Muhamedagic <dejanmm at fastmail.fm> wrote:

> crmsh used to make modifications in chunks, which was a bit
> complex due to element dependencies, but it worked if I can
> recall correctly. Then it got replaced by a full CIB replace
> (everybody claimed that it was the right thing to do).

Thought so at the time, yes. And I do think it cleaned up a few things,
we just need to improve it. The full CIB replace also seems to trigger
an election ...

> Of course, cmrsh know which elements got modified, which are new, and
> which should be deleted. But I'm not sure cibadmin can accept a diff
> of such a kind. Perhaps doing a shadow apply instead of cibadmin -R
> would help?

cibadmin -P.

If crm shell kept the XML it started out from around somewhere (easy for
an uncommitted shadow CIB, in any case), it could use crm_diff --filter
new to generate what has been changed in the current session and apply
that.

I *think* the CIB client side is supposed to do that already when
cibadmin -R is called; but that doesn't allow merging of updates that
have happened since and has this race.

Then most of the logic in crmsh would remain unchanged (i.e., it'd still
operate on whole CIBs only), but the way how it passes it on to
Pacemaker would improve. I hope.


Regards,
    Lars

-- 
Architect Storage/HA
SUSE LINUX Products GmbH, GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 21284 (AG Nürnberg)
"Experience is the name everyone gives to their mistakes." -- Oscar Wilde





More information about the Pacemaker mailing list