Hi Tapio,

Each ckpt write on active the gl_counter value is updated on standby
(via "avsv_ckpt_ArrivalCallback" which was registered while initializing
ckpt ) and  it stops updating gl_counter once it  becomes active
(avsv_ckpt.c, line 184).

Thanks & Regards,
AVM 


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Tuesday, February 19, 2008 5:15 PM
To: [EMAIL PROTECTED]
Subject: [Devel] Possible bug in AvSv sample application?

Hello all,

I have been trying to understand the AvSv sample application (in
directory samples/avsv/). There are two processes running, an active and
a spare. Their main loop is as follows:

avsv_app.c, line 149:

   while (1)
   {
      if ( SA_AMF_HA_ACTIVE == gl_ha_state )
      {
         gl_count++;

         /* Update the standby with this value */
         avsv_ckpt_data_write(&gl_count);
      }

      m_NCS_TASK_SLEEP(AVSV_APP_COUNTER_UPDATE_TIME);
   }


So the active process keeps incrementing the counter gl_count and writes
the result to a checkpoint.

The interesting stuff happens in function avsv_amf_csi_set_callback
(file avsv_amf.c, line 399). The first time it runs on the active
process, it sets the healthcheck mechanism. The healthcheck is trigged
so that it fails after a set number of times, at which point it makes an
error report.

When the standby process runs the callback, it reads the checkpoint and
writes it to its own copy of gl_count (avsv_ckpt.c, line 206). 

When the active process fails, the framework calls
avsv_amf_csi_set_callback with ha_state == SA_AMF_HA_ACTIVE in the
context of the old standby process (because the parameter ha_state
identifies the new state). This will now finalize the demo.

My problem is that the checkpoint is only ever read when the standby
process starts and is assigned the "standby" state, but this value is
then never re-read. The standby lives happily with an old value of
gl_counter until it becomes active, but then the demo is over. This does
not make much sense to me. Or have I misunderstood something?

-Tapio

_______________________________________________
Devel mailing list
[EMAIL PROTECTED]
http://list.opensaf.org/maillist/listinfo/devel

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________
_______________________________________________
Users mailing list
[email protected]
http://list.opensaf.org/maillist/listinfo/users

Reply via email to