osaf/services/saf/logsv/lgs/lgs_mbcsv.c |  20 ++++++++++----------
 tests/logsv/README                      |  32 ++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 10 deletions(-)


Fix incorrect handling of version 3/4 checkpoint handling

diff --git a/osaf/services/saf/logsv/lgs/lgs_mbcsv.c 
b/osaf/services/saf/logsv/lgs/lgs_mbcsv.c
--- a/osaf/services/saf/logsv/lgs/lgs_mbcsv.c
+++ b/osaf/services/saf/logsv/lgs/lgs_mbcsv.c
@@ -782,7 +782,7 @@ static uint32_t ckpt_encode_async_update
                data_v3 = (lgsv_ckpt_msg_v3_t 
*)(long)cbk_arg->info.encode.io_reo_hdl;
                vdata = data_v3;
                edp_function = edp_ed_ckpt_msg_v3;
-       } else if (lgs_is_peer_v2()) {
+       } else if (lgs_is_peer_v2()) {  /* Checkpoint version 2/3 is the same */
                data_v2 = (lgsv_ckpt_msg_v2_t 
*)(long)cbk_arg->info.encode.io_reo_hdl;
                vdata = data_v2;
                edp_function = edp_ed_ckpt_msg_v2;
@@ -1098,7 +1098,7 @@ static uint32_t ckpt_decode_log_cfg(lgs_
                ckpt_msg_v3 = ckpt_msg;
                lgs_cfg = &ckpt_msg_v3->ckpt_rec.lgs_cfg;
                edp_function = edp_ed_lgs_cfg_rec_v3;
-       } else if (lgs_is_peer_v2()) {
+       } else if (lgs_is_peer_v2()) {  /* Checkpoint version 2/3 is the same */
                ckpt_msg_v2 = ckpt_msg;
                lgs_cfg = &ckpt_msg_v2->ckpt_rec.lgs_cfg;
                edp_function = edp_ed_lgs_cfg_rec_v2;
@@ -1151,10 +1151,10 @@ static uint32_t ckpt_decode_async_update
        if (lgs_is_peer_v5()) {
                ckpt_msg_v5->header = hdr;
                ckpt_msg = ckpt_msg_v5;
-       } else if (lgs_is_peer_v4() && (hdr_ptr->ckpt_rec_type == 
LGS_CKPT_LGS_CFG_V3)) {
+       } else if (lgs_is_peer_v4()) {
                ckpt_msg_v3->header = hdr;
                ckpt_msg = ckpt_msg_v3;
-       } else if (lgs_is_peer_v2()) {
+       } else if (lgs_is_peer_v2()) { /* Checkpoint version 2/3 is the same */
                ckpt_msg_v2->header = hdr;
                ckpt_msg = ckpt_msg_v2;
        } else {
@@ -1168,9 +1168,9 @@ static uint32_t ckpt_decode_async_update
                TRACE_2("\tINITIALIZE REC: UPDATE");
                if (lgs_is_peer_v5()) {
                        reg_rec = &ckpt_msg_v5->ckpt_rec.initialize_client;
-               } else if (lgs_is_peer_v3()) {
+               } else if (lgs_is_peer_v4()) {
                        reg_rec = &ckpt_msg_v3->ckpt_rec.initialize_client;
-               } else if (lgs_is_peer_v2()) {
+               } else if (lgs_is_peer_v2()) { /* Checkpoint version 2/3 is the 
same */
                        reg_rec = &ckpt_msg_v2->ckpt_rec.initialize_client;
                } else {
                        reg_rec = &ckpt_msg_v1->ckpt_rec.initialize_client;
@@ -1193,9 +1193,9 @@ static uint32_t ckpt_decode_async_update
                TRACE_2("\tSTREAM OPEN: UPDATE");
                if (lgs_is_peer_v5()) {
                        stream_open = &ckpt_msg_v5->ckpt_rec.stream_open;
-               } else if (lgs_is_peer_v3()) {
+               } else if (lgs_is_peer_v4()) {
                        stream_open = &ckpt_msg_v3->ckpt_rec.stream_open;
-               } else if (lgs_is_peer_v2()) {
+               } else if (lgs_is_peer_v2()) { /* Checkpoint version 2/3 is the 
same */
                        stream_open = &ckpt_msg_v2->ckpt_rec.stream_open;
                } else {
                        stream_open = &ckpt_msg_v1->ckpt_rec.stream_open;
@@ -1449,7 +1449,7 @@ static uint32_t process_ckpt_data(lgs_cb
        } else if (lgs_is_peer_v4()) {
                data_v3 = data;
                lgsv_ckpt_msg_type = data_v3->header.ckpt_rec_type;
-       } else if (lgs_is_peer_v2()) {
+       } else if (lgs_is_peer_v2()) { /* Checkpoint version 2/3 is the same */
                data_v2 = data;
                lgsv_ckpt_msg_type = data_v2->header.ckpt_rec_type;
        } else {
@@ -2182,7 +2182,7 @@ uint32_t lgs_ckpt_send_async(lgs_cb_t *c
        } else if (lgs_is_peer_v4()) {
                lgsv_ckpt_msg_v3_t *ckpt_rec_v3 = ckpt_rec;
                ckpt_rec_type = ckpt_rec_v3->header.ckpt_rec_type;
-       } else if (lgs_is_peer_v2()) {
+       } else if (lgs_is_peer_v2()) { /* Checkpoint version 2/3 is the same */
                lgsv_ckpt_msg_v2_t *ckpt_rec_v2 = ckpt_rec;
                ckpt_rec_type = ckpt_rec_v2->header.ckpt_rec_type;
        } else {
diff --git a/tests/logsv/README b/tests/logsv/README
--- a/tests/logsv/README
+++ b/tests/logsv/README
@@ -10,3 +10,35 @@ The second TC tries to set the data grou
 In order to help the TC passed, "log-data" group must be existing and be added
 to supplementary group list of the user as which LOGSV is running.
 Otherwise that TC will be skipped.
+
+
+SET UP A CLUSTER 02 NODES WITH DIFFERENT CKPT VERSIONS
+------------------------------------------------------
+There was issue when two nodes runs with different ckpt versions.
+Ticket #1459 is an example. How to setup this on UML?
+
+Here is guideline for environment preparing for the case active logsv with 
version #5,
+standby logsv with version #4.
+
+1. Create 02 separate folders, one refers to branch 5.0.x (folder A),
+   other one refers to 4.6.x branch (folder B).
+
+2. Build OpenSAF and UML for them (refer to Wiki)
+
+3. Open 2 terminals. On each one, change directory to ../tools/cluster_sim_uml
+
+4. Start active node SC-1 with logsv version #5.
+   cluster_sim_uml> ./opensaf nodestart 1
+
+5. Start standby node SC-2 with logsv version #4
+   cluster_sim_uml> ./opensaf nodestart 2
+
+6. Wait for seconds to make sure all OpenSAF services come up.
+
+7. Run test by `logtest` app with no option.
+
+8. Observe both nodes if there is any issue (e.g: node is rebooted)
+
+If want to test the case active logsv version #4, standby logsv version #5, 
reboot above SC-1 (swithover).
+
+

------------------------------------------------------------------------------
_______________________________________________
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to