<div dir="ltr">Thank you for the comprehensive answer. =)</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr">Thank you,<div>Kostia</div></div></div></div></div></div>
<br><div class="gmail_quote">On Thu, Dec 1, 2016 at 5:56 PM, Ken Gaillot <span dir="ltr"><<a href="mailto:kgaillot@redhat.com" target="_blank">kgaillot@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 12/01/2016 06:04 AM, Kostiantyn Ponomarenko wrote:<br>
> OK, now I see. I still have a few questions.<br>
> 1. Is there a good reason to not remove the attribute totally if it<br>
> is "deleted"?<br>
<br>
</span>We do this for two reasons:<br>
<br>
1. You can "delete" an attribute for just one node, while leaving it on<br>
other nodes. Attrd needs to remember the attribute as a whole, and just<br>
delete the value for the one node. Even deleting an attribute on all<br>
nodes is done by separate deletes for each node, so this matters even then.<br>
<br>
2. Information about the attribute needs to continue to exist in order<br>
to reliably process changes from different nodes. I forget the exact<br>
details, but I remember looking into it before.<br>
<br>
These limitations could possibly be addressed by keeping the attribute<br>
but setting a "deleted" flag, and changing how those would be reported,<br>
but it's not on the radar right now.<br>
<span class=""><br>
> 2. Does "attrd_updater" sets attributes to "status" configuration<br>
> section only?<br>
<br>
</span>Yes (when using corosync 2).<br>
<br>
crm_attribute modifies the CIB directly, so there is no way to batch its<br>
changes with a delay.<br>
<span class=""><br>
> 3. Do I need to modify/set "--delay" to 0 before removing or<br>
> changing the attribute? Because now I see that previously set delay<br>
> works when I delete the attribute (--delete).<br>
<br>
</span>It depends on what you want. The point of the delay is to write changes<br>
out to the CIB only every so often, to save disk I/O. If you're<br>
potentially changing attribute values several times per second, this<br>
would be a huge performance boost. The delay affects all changes,<br>
including deletes.<br>
<br>
If you want a specific change to be written to the CIB immediately, then<br>
yes, you have to set the delay to 0. You can either change the delay<br>
beforehand with attrd_updater --update-delay or change the delay and<br>
value together with --update-both.<br>
<span class=""><br>
> 4. Does a delay set only one time work until it's unset (set to 0)?<br>
<br>
</span>Yes<br>
<span class=""><br>
> Thank you,<br>
> Kostia<br>
><br>
> On Wed, Nov 30, 2016 at 10:39 PM, Ken Gaillot <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
</span><span class="">> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>> wrote:<br>
><br>
> On 11/30/2016 11:31 AM, Kostiantyn Ponomarenko wrote:<br>
> > Hi Ken,<br>
> ><br>
> > I didn't look into the logs, but I experimented with it for a while.<br>
> > Here is what I found.<br>
> ><br>
> > It worked for you because this attribute - "my-attr" - has not ever been<br>
> > set before in that cluster.<br>
> ><br>
> > So if you set an attribute, then remove it, and then set it with<br>
> > "--delay", like:<br>
> ><br>
> > # attrd_updater -N node-0 -n my-attr --update false --delay 20<br>
> ><br>
> > , this delay (dampening) won't work.<br>
><br>
> Once set, attributes are not truly deleted -- only their values are<br>
> cleared. And --delay has no effect with --update if the attribute<br>
> already exists, which is what you see above.<br>
><br>
> To set a delay on an already existing attribute, you have to use<br>
> attrd_updater --update-delay or --update-both.<br>
><br>
> > Moreover, when you delete this attribute the actual remove will be<br>
> > delayed by that "--delay" which was used when the attribute was set.<br>
> ><br>
> ><br>
> > Thank you,<br>
> > Kostia<br>
> ><br>
> > On Tue, Nov 29, 2016 at 1:08 AM, Ken Gaillot <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
</span><span class="">> > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>>> wrote:<br>
> ><br>
</span><div><div class="h5">> > On 11/24/2016 05:24 AM, Kostiantyn Ponomarenko wrote:<br>
> > > Attribute dampening doesn't work for me also.<br>
> > > To test that I have a script:<br>
> > ><br>
> > > attrd_updater -N node-0 -n my-attr --update false --delay 20<br>
> > > sleep 3<br>
> > > attrd_updater -N node-0 -n my-attr --update true<br>
> > > sleep 7<br>
> > > attrd_updater -N node-1 -n my-attr --update true<br>
> ><br>
> > This sequence works for me -- the attributes are not written<br>
> to the live<br>
> > CIB until the end of the delay, when both are written at the<br>
> same time.<br>
> ><br>
> > The remaining issue must be with the policy engine. You could<br>
> look at<br>
> > the detail log on the DC when these changes were made; you<br>
> should see<br>
> > info-level messages with the CIB change with both values<br>
> together (lines<br>
> > with "cib_perform_op: ++" and the attribute values), then<br>
> "Transition<br>
> > aborted" with "Transient attribute change", then a bunch of<br>
> "pengine:"<br>
> > lines saying what the cluster wants to do with each resource.<br>
> ><br>
> > There should be some information about the scores used to<br>
> place the<br>
> > resources.<br>
> ><br>
> > ><br>
> > > All my resources have this rule in Pacemaker config:<br>
> > ><br>
> > > crm configure location res1-location-rule res1 \<br>
> > > rule 0: my-attr eq true \<br>
> > > rule -inf: my-attr ne true<br>
> > ><br>
> > > On a working two-node cluster I remove "my-attr" from both<br>
> nodes.<br>
> > > Then run my script. And all resources start on node-0.<br>
> > > Am I doing something wrong?<br>
> > > Or maybe my understanding of an attribute dampening is not<br>
> correct?<br>
> > ><br>
> > > My Pacemaker version is 1.1.13. (heh, not the last one, but<br>
> it is what<br>
> > > it is ...)<br>
> > ><br>
> > > Thank you,<br>
> > > Kostia<br>
> > ><br>
> > > On Wed, Nov 23, 2016 at 7:27 PM, Kostiantyn Ponomarenko<br>
> > > <<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.ponomarenko@gmail.<wbr>com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>><br>
> > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>>><br>
> > > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>><br>
> > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>>>>> wrote:<br>
> > ><br>
> > > Maybe I am doing something wrong, but I cannot set "status" section<br>
> > > node attributes to a shadow cib, cluster applies them immediately.<br>
> > > To try it out I do in a console:<br>
> > ><br>
> > > crm_shadow --create test<br>
> > > crm_attribute --type nodes --node node-0 --name my-attribute<br>
> > > --update 1 --lifetime=reboot<br>
> > ><br>
> > > And this attribute is set to the live cluster configuration immediately.<br>
> > > What am I doing wrong?<br>
> > ><br>
> > > Thank you,<br>
> > > Kostia<br>
> > ><br>
> > > On Tue, Nov 22, 2016 at 11:33 PM, Kostiantyn Ponomarenko<br>
> > > <<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.ponomarenko@gmail.<wbr>com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>><br>
> > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>>><br>
> > > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>><br>
> > <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a><br>
> <mailto:<a href="mailto:konstantin.ponomarenko@gmail.com">konstantin.<wbr>ponomarenko@gmail.com</a>>>>> wrote:<br>
> > ><br>
> > > Ken,<br>
> > > Thank you for the explanation.<br>
> > > I will try this low-level way of shadow cib creation tomorrow.<br>
> > > PS: I will sleep much better with this excellent news/idea. =)<br>
> > ><br>
> > > Thank you,<br>
> > > Kostia<br>
> > ><br>
> > > On Tue, Nov 22, 2016 at 10:53 PM, Ken Gaillot<br>
> > > <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>><br>
</div></div>> > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
<div class="HOEnZb"><div class="h5">> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>>><wbr>> wrote:<br>
> > ><br>
> > > On 11/22/2016 04:39 AM, Kostiantyn Ponomarenko<br>
> wrote:<br>
> > > > Using "shadow cib" in crmsh looks like a good<br>
> idea, but it doesn't work<br>
> > > > with node attributes set into "status" section<br>
> of Pacemaker config.<br>
> > > > I wonder it it is possible to make it work<br>
> that way.<br>
> > ><br>
> > > Forgot to mention -- the shadow CIB is probably<br>
> the best way<br>
> > > to do this.<br>
> > > I don't know if there's a way to do it in crmsh,<br>
> but you can<br>
> > > use it with<br>
> > > the low-level commands crm_shadow and crm_attribute<br>
> > > --lifetime=reboot.<br>
> > ><br>
> > > > Ken,<br>
> > > >>> start dampening timer<br>
> > > > Could you please elaborate more on this. I<br>
> don't get how I can set this<br>
> > > > timer.<br>
> > > > Do I need to set this timer for each node?<br>
> > > ><br>
> > > ><br>
> > > > Thank you,<br>
> > > > Kostia<br>
> > > ><br>
> > > > On Mon, Nov 21, 2016 at 9:30 AM, Ulrich Windl<br>
> > > > <<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>><br>
> > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>>><br>
> > > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>><br>
> > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>>>><br>
> > > > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>><br>
> > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>>><br>
> > > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>><br>
> > <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a><br>
> <mailto:<a href="mailto:Ulrich.Windl@rz.uni-regensburg.de">Ulrich.Windl@rz.uni-<wbr>regensburg.de</a>>>>>> wrote:<br>
> > > ><br>
> > > > >>> Ken Gaillot <<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>><br>
> > > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
> > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>>><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>><br>
> > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>><br>
> > > <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a><br>
> <mailto:<a href="mailto:kgaillot@redhat.com">kgaillot@redhat.com</a>>>><wbr>>><br>
> > > > schrieb am 18.11.2016 um 16:17 in Nachricht<br>
> > > ><br>
> <<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-00be-<wbr>e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>>><br>
> > ><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>>><wbr>><br>
> > > ><br>
> > ><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>>><br>
> > ><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>><br>
> > <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a><br>
> <mailto:<a href="mailto:d6f449da-64f8-12ad-00be-e772d8e382ca@redhat.com">d6f449da-64f8-12ad-<wbr>00be-e772d8e382ca@redhat.com</a>>><wbr>>>>:<br>
> > > > > On 11/18/2016 08:55 AM, Kostiantyn<br>
> Ponomarenko<br>
> > wrote:<br>
> > > > >> Hi folks,<br>
> > > > >><br>
> > > > >> Is there a way to set a node attribute<br>
> to the<br>
> > > "status" section for few<br>
> > > > >> nodes at the same time?<br>
> > > > >><br>
> > > > >> In my case there is a node attribute<br>
> which allows<br>
> > > some resources to<br>
> > > > >> start in the cluster if it is set.<br>
> > > > >> If I set this node attribute for say two<br>
> > nodes in a<br>
> > > way - one and then<br>
> > > > >> another, than these resources are not<br>
> distributed<br>
> > > equally between these<br>
> > > > >> two nodes. That because Pacemaker picks<br>
> the first<br>
> > > node to with this<br>
> > > > >> attribute is set and immediately starts all<br>
> > allowed<br>
> > > resources on it. And<br>
> > > > >> this is not the behavior i would like<br>
> to get.<br>
> > > > >><br>
> > > > >> Thank you,<br>
> > > > >> Kostia<br>
> > > > ><br>
> > > > > Not that I know of, but it would be a<br>
> good feature<br>
> > > to add to<br>
> > > > > attrd_updater and/or crm_attribute.<br>
> > > ><br>
> > > > With crm (shell) you don't have<br>
> transactions for<br>
> > node<br>
> > > attributes,<br>
> > > > but for the configuration. So if you add a<br>
> location<br>
> > > restriction<br>
> > > > preventing any resources on your nodes,<br>
> then enable<br>
> > > the nodes, and<br>
> > > > then delete the location restrictions in one<br>
> > > transaction, you might<br>
> > > > get what you want. It's not elegant, but<br>
> itt ill do.<br>
> > > ><br>
> > > > To the crm shell maintainer: Is is<br>
> difficult to<br>
> > build<br>
> > > transactions<br>
> > > > to node status changes? The problem I see is<br>
> > this: For<br>
> > > configuration<br>
> > > > you always have transactions (requiring<br>
> > "commit), but<br>
> > > for nodes you<br>
> > > > traditionally have non (effects are<br>
> immediate). So<br>
> > > you'd need a<br>
> > > > thing like "start transaction" which<br>
> requires a<br>
> > > "commit" or some<br>
> > > > kind of abort later.<br>
> > > ><br>
> > > > I also don't know whether a "shadow CIB"<br>
> would help<br>
> > > for the original<br>
> > > > problem.<br>
> > > ><br>
> > > > Ulrich<br>
> > > ><br>
> > > > ><br>
> > > > > You can probably hack it with a dampening<br>
> > value of a<br>
> > > few seconds. If<br>
> > > > > your rule checks for a particular value<br>
> of the<br>
> > > attribute, set all the<br>
> > > > > nodes to a different value first, which<br>
> will write<br>
> > > that value and<br>
> > > > start<br>
> > > > > the dampening timer. Then set all the<br>
> > attributes to<br>
> > > the desired value,<br>
> > > > > and they will get written out together<br>
> when the<br>
> > > timer expires.<br>
</div></div></blockquote></div><br></div>