Hi Tapio, To support hot standby, OpenSAF checkpoint service is implemented extensions to the B.01.01 Specs. Using this feature, the application registers a "arrival callback" with ckpt services and when ever the write happens to the checkpoint, application will be notified using "arrival callback". After getting the notification, application may invoke the ckpt read and get the data.
The details on how to use the arrival callback is clearly documented in OpenSAF Checkpoint Service document. This sample application is demonstrating this feature and the reads are happenings as and when the data is written to the checkpoint. In this case, it is not necessary to make the extra read when the standby becomes active. In case if you don't want to use "hot standby" you need make the following changes to the sample application - Remove the "Arrival callback" registration in the initialize process. - Invoke checkpoint read when standby becomes active. Please let me know, if you have any questions on this. Thanks, Sudhakar -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of ALLA VENKATA MAHESH-TFH648 Sent: Wednesday, February 20, 2008 3:14 PM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Cc: users@list.opensaf.org Subject: Re: [Users] [Devel] Possible bug in AvSv sample application? 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 Users@list.opensaf.org http://list.opensaf.org/maillist/listinfo/users ______________________________________________________________________ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email ______________________________________________________________________ _______________________________________________ Users mailing list Users@list.opensaf.org http://list.opensaf.org/maillist/listinfo/users