Well, I'm not Cfengine developer, but I can take part in the
theoretical discussion )

Cfengine uses single promise locking mechanism, so in general you need
to define or cancel classes (using ifvarclass) to implement
"transactions" (i.e. all or nothing approach for series of promises of
different kind). Perhaps, if Cfengine could have implemented bundle
wide locking, so that the whole set of promises inside a bundle could
have been locked by a running instance of cf-agent, it might have
greatly reduced burden of building dependency chains by hand. On the
other hand, this approach might greatly and unnecessarily reduce
flexibility. Careful thinking must be done before making any crucial
decisions like that.

Perhaps, having some kind of option inside body agent control (e.g.
lockby => "promise" or "bundle") could have allowed one to choose
their best. Meanwhile, I'm pretty sure that edit_line bundles must be
locked at whole regardlessly.

2011/3/15 David Lee <david....@ecmwf.int>:
> Thanks, Mark and Seva.
>
> If you produce a beta RPM (RH-5/Centos-5) with this, let me know and I
> can try it out for you.
>
> Going more theoretical, this raises a worrying question.  I had written
> the bundle that contained the "delete_lines" and "insert_lines" on the
> assumption that this pair of operations, taken together, would have
> promised to deliver an atomic "all or nothing" transaction.  Is this not
> the case?  If not, then by what means can one achieve an atomic set of
> actions?
>
> I realise that fully generalising this might be very tricky, perhaps
> even verging on impossible.  But equally there are probably cases (e.g.
> a set of file edits in a single file) where it is both highly desirable
> and realistically achievable.  And there are probably similar cases
> (e.g. setting up network interfaces on some OSes) where a set of edits
> across more than one file, as an atomic action, may also be highly
> desirable.  (Indeed, my phrase "highly desirable" might, in some
> circumstances, need to be read as "essential".)
>
> Anyway, thanks for the attention and replies.
>
> --
> David Lee
>
>
> Mark Burgess wrote:
>> Thanks for reminding me about this. I was sure this had already been done.
>>
>> On 03/14/2011 09:05 PM, Seva Gluschenko wrote:
>>> David,
>>>
>>> if by occasion you experience concurrent cf-agent runs, there's a
>>> situation possible when one instance locks insert_lines promises and
>>> another one locks delete_lines promises. There were discussions with
>>> Mark about locking the whole file to prevent such undesired
>>> concurrency overlaps, and I hope he will implement it in the next
>>> release.
>>>[...]
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>



-- 
SY, Seva Gluschenko.
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to