Forum: CFEngine Help
Subject: Re: cf_promises_validated : bug 1258
Author: nickanderson
Link to topic: https://cfengine.com/forum/read.php?3,27307,27318#msg-27318

cf_promises_validated dates dates back to 3.1.2 afaik.
Eynstein has some great extended change logs and the one for 3.1.2 covers 
cf_promises_validated under "Caching Policy Checks" 
http://www.blogcompiler.com/2010/12/29/cfengine-3-1-2-extended-change-log/

In it he says that WORKDIR/masterfiles/cf_promises_validated is touched when 
policy has been successfully verified. I think some details are missing from 
that. It is my understanding that WORKDIR/masterfiles/cf_promises_validated is 
updated (now with a datestamp) when _new_ policy in WORKDIR/inputs is validated.

So as I understand it the flow is something like this

Agent executes failsafe
On the hub only all of masterfiles is checked against inputs for updates (it 
ignores cf_promises_validated)
Lets say this is a new hub, so all masterfiles are copied to inputs
Agent executes normal policy run
Agent sees that inputs are different from last time and they validate so it 
updates masterfiles/cf_promises_validated

Now a client calls in (when it executes failsafe), and sees that 
cf_promises_validated is different from the one it has, so it proceeds to 
compare the rest of masterfiles against its inputs to see what needs updating, 
updates
Agent executes its normal run
It sees that files have changed in inputs so it updates 
masterfiles/cf_promises_validated (on the client, likely nothing will ever use 
this file, but it behaves the same everywhere)

Time for the agent to execute failsafe again on the hub
All of masterfiles are checked against inputs, but there are not differences so 
no changes are made
Agent executes normal policy run
The files in inputs validate, but since none are different from last time 
masterfiles/cf_promises_validated does not need updated

Client calls in
cf_promises_validated is not different from the last time it compared so 
nothing needs updated and it proceeds to execute its normal run

I might be wrong about how some of that works, if so I am sure someone will 
correct me :)

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to