Richard,

 OK. After another look at the code I am sure setting "old" to 0 does
not hurt. So, what about below one?

Martin

diff -u -r1.45 process_xml.c
--- process_xml.c       18 Nov 2004 20:14:31 -0000      1.45
+++ process_xml.c       21 Mar 2006 12:46:45 -0000
@@ -821,11 +821,15 @@
          if (xt->tag == VERSION_TAG)
             {
                   /* Process the version tag later */
-                  if(! strstr( attr[i+1], "2.5." ) )
+                  if( strcmp( attr[i+1], "2.5." ) < 0 )
                      {
                          debug_msg("[%s] is an OLD version",
xmldata->ds->name);
                          xmldata->old = 1;
                       }
+                  else
+                     {
+                         xmldata->old = 0;
+                      }
              }
        }
    return 0;


--- [EMAIL PROTECTED] wrote:

> Hi,
> 
> just tested, yup - it works, and you are right, strcmp is required.
> Thanks.
> 
> But I still think you need the else to set xmldata->old to 0.
> If not done, surely this will mean that the variable gets stuck on 1
> for subsequent clusters/grids after the first old cluster is
> encountered.
> There is no code anywhere to set it to zero subsequently that I can
> see.
> Am I missing it?
> 
> kind regards,
> richard
> 
> -----Original Message-----
> From: Martin Knoblauch [mailto:[EMAIL PROTECTED] 
> Sent: 21 March 2006 12:14
> To: Grevis, Richard: IT (LDN);
> [email protected]
> Subject: Re: [Ganglia-developers] Possible bug in hosts up
> calculation
> when federating clusters.
> 
> 
> Hi Richard,
> 
>  oops. You are both right and wrong :-) Looking at the code and
> comments
> for "old", it seems that the whole logic is pre-3.0. It was used to
> distinguish between 2.5.x and prior versions. For that purpose the
> code
> is right. Of course, it now fails when it encounters the 3.0.X
> string.
> 
>  Something like this should solve it. Care to test? I am not sure
> about
> setting old to 0 in the other case. In any case, the whole xmldata_t
> structure is initialized early on.
> 


------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www:   http://www.knobisoft.de

Reply via email to