[ClusterLabs] Antw: Re: Why is last-lrm-refresh part of the CIB config?

2019-09-12 Thread Ulrich Windl
>>> Jan Pokorný  schrieb am 12.09.2019 um 11:48 in
Nachricht
<20190912094840.gl29...@redhat.com>:
> On 12/09/19 09:27 +0200, Ulrich Windl wrote:
> Jan Pokorný  schrieb am 10.09.2019 um 17:38
> in Nachricht <20190910153832.gj29...@redhat.com>:
>>> 
>>> Just looking at how to provisionally satisfy the needs here, I can
>>> suggest this "one-liner" as a filter to let the to-archive-copies
>>> through (depending on the aposteriori diff):
>>> 
>>>   { xsltproc - <(cibadmin -Q) | cat; } <>>   >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform;>
>>> 
>>>   
>>> 
>>>   
>>> 
>>> 
>>>   
>>>   EOF
>>> 
>> 
>> [...]
>>> plain POSIX shell.  The additional complexity stems from the desire
>>> so as not to keep blank lines where anything got filtered out.
>> 
>> Actually it "eats up" the line break and identation before
>>  also, like here:
>> 
>>> id="cib-bootstrap-options-stonith-enabled"/>
>>> id="cib-bootstrap-options-placement-strategy"/>
>> -  > name="last-lrm-refresh" value="1567945827"/>
>> -  > id="cib-bootstrap-options-maintenance-mode"/>
>> -
>> +  > id="cib-bootstrap-options-maintenance-mode"/>
>>
>>
> 
> Good spot :-)
> 
> Untested fix (you'll get the idea, check just the first match element
> on the preceding-sibling axis):

Those, who can, can ;-) (fix confirmed):
--- /tmp/cib2   2019-09-12 09:21:31.427435264 +0200
+++ /tmp/cib1   2019-09-12 12:18:28.115354718 +0200
@@ -1,3 +1,4 @@
+
 
   
 
@@ -7,7 +8,6 @@
   
   
   
-  
   
 
   

> 
>   { xsltproc - <(cibadmin -Q) | cat; } 
> 
>   
> 
>   
> 
> 
>   
>   EOF
> 
> Some wiggling around this idea would certainly lead to desired results.
> OTOH, if you backfeed that output back to crm (to get the reinstating
> sequence), whitespaces are pretty irrelevant, allowing for vast
> simplification.
> 
> And when you are after the actual XML diff, text-based diff is
> a *bad choice* in general anyway.  An identical XML content can be

I agree that there are many ways to represent one XML content. Fortunately
cibadmin does not put everything in one line ;-)

> expressed with a countless number of variations in the serialized
> form (plain text projection), and you are really interested in the
> semantical identity only.  That text-based diff more or less work
> is rather an implementation detail not to be relied upon across
> SW updates, etc. (libxml2-specific environment variables could affect
> the output as well!).  There are multiple "XML diff" tools, perhaps
> even crm_diff would do (but specialities like comments, processing
> instructions etc. may not work well with it, admittedly they probably
> won't be present to begin with).

I'm hoping on the constant (same locale) "same input, same program, same
output" ;-)

> 
> -- 
> Poki



___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/

[ClusterLabs] Antw: Re: Why is last-lrm-refresh part of the CIB config?

2019-09-12 Thread Ulrich Windl
>>> Jan Pokorný  schrieb am 10.09.2019 um 17:38 in
Nachricht
<20190910153832.gj29...@redhat.com>:
> On 10/09/19 08:06 +0200, Ulrich Windl wrote:
> Ken Gaillot  schrieb am 09.09.2019 um 17:14
> in Nachricht
> <9e51c562c74e52c3b9e5f85576210bf83144fae7.ca...@redhat.com>:
>>> On Mon, 2019‑09‑09 at 11:06 +0200, Ulrich Windl wrote:
 In recent pacemaker I see that last‑lrm‑refresh is included in the
 CIB config (crm_config/cluster_property_set), so CIBs are "different"
 when they are actually the same.
 
 Example diff:
 ‑   name="last‑lrm‑refresh" value="1566194010"/>
 +   name="last‑lrm‑refresh" value="1567945827"/>
 
 I don't see a reason for having that. Can someone explain?
>>> 
>>> New transitions (re‑calculation of cluster status) are triggered by
>>> changes in the CIB. last‑lrm‑refresh isn't really special in any way,
>>> it's just a value that can be changed arbitrarily to trigger a new
>>> transition when nothing "real" is changing.
>> 
>> But wouldn't it be more appropriate in the status section of the CIB then?
>> Also isn't pacemaker working with CIB digests anyway? And there is the
>> three-number CIB versioning, too.
>> 
>>> I'm not sure what would actually be setting it these days; its use has
>>> almost vanished in recent code. I think it was used more commonly for
>>> clean‑ups in the past.
>> 
>> My guess is that a crm configure did such a change.
>> 
>> Why I care: I'm archiving CIB configuration (but not status) changes
>> (that is the CIBs and the diffs); so I don't like such dummy changes
>> ;-)
> 
> Just looking at how to provisionally satisfy the needs here, I can
> suggest this "one-liner" as a filter to let the to-archive-copies
> through (depending on the aposteriori diff):
> 
>   { xsltproc - <(cibadmin -Q) | cat; } 
> 
>   
> 
>   
> 
> 
>   
>   EOF
> 

[...]
> plain POSIX shell.  The additional complexity stems from the desire
> so as not to keep blank lines where anything got filtered out.

Actually it "eats up" the line break and identation before
 also, like here:

   
   
-  
-  
-
+  
   
   

Regards,
Ulrich


___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/

[ClusterLabs] Antw: Re: Why is last-lrm-refresh part of the CIB config?

2019-09-12 Thread Ulrich Windl
>>> Jan Pokorný  schrieb am 10.09.2019 um 17:38 in
Nachricht
<20190910153832.gj29...@redhat.com>:
> On 10/09/19 08:06 +0200, Ulrich Windl wrote:
> Ken Gaillot  schrieb am 09.09.2019 um 17:14
> in Nachricht
> <9e51c562c74e52c3b9e5f85576210bf83144fae7.ca...@redhat.com>:
>>> On Mon, 2019‑09‑09 at 11:06 +0200, Ulrich Windl wrote:
 In recent pacemaker I see that last‑lrm‑refresh is included in the
 CIB config (crm_config/cluster_property_set), so CIBs are "different"
 when they are actually the same.
 
 Example diff:
 ‑   name="last‑lrm‑refresh" value="1566194010"/>
 +   name="last‑lrm‑refresh" value="1567945827"/>
 
 I don't see a reason for having that. Can someone explain?
>>> 
>>> New transitions (re‑calculation of cluster status) are triggered by
>>> changes in the CIB. last‑lrm‑refresh isn't really special in any way,
>>> it's just a value that can be changed arbitrarily to trigger a new
>>> transition when nothing "real" is changing.
>> 
>> But wouldn't it be more appropriate in the status section of the CIB then?
>> Also isn't pacemaker working with CIB digests anyway? And there is the
>> three-number CIB versioning, too.
>> 
>>> I'm not sure what would actually be setting it these days; its use has
>>> almost vanished in recent code. I think it was used more commonly for
>>> clean‑ups in the past.
>> 
>> My guess is that a crm configure did such a change.
>> 
>> Why I care: I'm archiving CIB configuration (but not status) changes
>> (that is the CIBs and the diffs); so I don't like such dummy changes
>> ;-)
> 
> Just looking at how to provisionally satisfy the needs here, I can
> suggest this "one-liner" as a filter to let the to-archive-copies
> through (depending on the aposteriori diff):
> 
>   { xsltproc - <(cibadmin -Q) | cat; } 
> 
>   
> 
>   
> 
> 
>   
>   EOF
> 
> Above, "cat" is only for demonstration of how to further extend your
> pipeline (you can directly ground those flying data into a file
> instead).  It relies on bash extension (process substitution) over
> plain POSIX shell.  The additional complexity stems from the desire
> so as not to keep blank lines where anything got filtered out.

Hi!

You proved that you're a master of BASH ;-)
Of course I could filter the undesired attribute, but when "backing up" the
CIB's configuration setting, I'd prefer an unmodified version.

In case it's not clear what I'm talking about:
Assume you have some configuration where resource A is started; call it "C1".
Then stop A, call configuration "C2"
Finally staring A again, call it "C3".

What I'd like to see is simply that "C1" is equal to "C3".

Another interesting side-note (from "crm configure show"):
 property cib-bootstrap-options: \
have-watchdog=true \
-   dc-version="1.1.19+20180928.0d2680780-1.8-1.1.19+20180928.0d2680780"
\
+  
dc-version="1.1.19+20181105.ccd6b5b10-3.10.1-1.1.19+20181105.ccd6b5b10" \
cluster-infrastructure=corosync \
cluster-name=cluster3 \
stonith-enabled=true \
placement-strategy=utilization \
-   last-lrm-refresh=1566194010 \
+   last-lrm-refresh=1567945827 \
maintenance-mode=false

Here, there is a diff of the DC version and the last_lrm_refresh. It was
caused by a node reboot causing the DC to be re-elected on a node with a newer
pacemaker. Does it make sense to store the DC version in the CIB when not
storing the DC node? Maybe the dc-version should be in the status section.

Regards,
Ulrich

> 
> Hope this helps for now.
> 
> -- 
> Jan (Poki)



___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/

[ClusterLabs] Antw: Re: Why is last-lrm-refresh part of the CIB config?

2019-09-10 Thread Ulrich Windl
>>> Ken Gaillot  schrieb am 09.09.2019 um 17:14 in
Nachricht
<9e51c562c74e52c3b9e5f85576210bf83144fae7.ca...@redhat.com>:
> On Mon, 2019‑09‑09 at 11:06 +0200, Ulrich Windl wrote:
>> Hi!
>> 
>> In recent pacemaker I see that last‑lrm‑refresh is included in the
>> CIB config (crm_config/cluster_property_set), so CIBs are "different"
>> when they are actually the same.
>> 
>> Example diff:
>> ‑  > name="last‑lrm‑refresh" value="1566194010"/>
>> +  > name="last‑lrm‑refresh" value="1567945827"/>
>> 
>> I don't see a reason for having that. Can someone explain?
>> 
>> Regards,
>> Ulrich
> 
> New transitions (re‑calculation of cluster status) are triggered by
> changes in the CIB. last‑lrm‑refresh isn't really special in any way,
> it's just a value that can be changed arbitrarily to trigger a new
> transition when nothing "real" is changing.

But wouldn't it be more appropriate in the status section of the CIB then?
Also isn't pacemaker working with CIB digests anyway? And there is the
three-number CIB versioning, too.

> 
> I'm not sure what would actually be setting it these days; its use has
> almost vanished in recent code. I think it was used more commonly for
> clean‑ups in the past.

My guess is that a crm configure did such a change.

Why I care: I'm archiving CIB configuration (but not status) changes (that is
the CIBs and the diffs); so I don't like such dummy changes ;-)

Regards,
Ulrich



___
Manage your subscription:
https://lists.clusterlabs.org/mailman/listinfo/users

ClusterLabs home: https://www.clusterlabs.org/