|
From: Zoran M. <zor...@er...> - 2016-03-01 10:09:11
|
Summary: imm: add check for SC absence and 2PBE in cold sync for IMMD [#1625]
Review request for Trac Ticket(s): 1625
Peer Reviewer(s): Neelakanta, Hung
Pull request to: Zoran
Affected branch(es): default(5.0)
Development branch: default(5.0)
--------------------------------
Impacted area Impact y/n
--------------------------------
Docs n
Build system n
RPM/packaging n
Configuration files n
Startup scripts n
SAF services y
OpenSAF services n
Core libraries n
Samples n
Tests n
Other n
Comments (indicate scope for each "y" above):
---------------------------------------------
changeset 1ad29ffda8578a73a36ac44219593a4e4b4e5840
Author: Zoran Milinkovic <zor...@er...>
Date: Tue, 01 Mar 2016 11:04:20 +0100
imm: add check for SC absence and 2PBE in cold sync for IMMD [#1625]
SC absence allowed part will prevent that controllers don't have different
SC absence configuration. When 2PBE or SC absence allowed misconfiguration
on controllers is detected, IMMD will exit in cold sync.
After few times restarting due to SC absence or 2PBE misconfiguration, AMF
will reboot the node.
Complete diffstat:
------------------
osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
osaf/services/saf/immsv/immd/immd_evt.c | 3 ---
osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 56 insertions(+), 5 deletions(-)
Testing Commands:
-----------------
Testing, Expected Results:
--------------------------
Test a case when 2PBE is disabled/enabled and SC absence allowed has different values on controllers. When standby node starts, the node should restart.
Conditions of Submission:
-------------------------
Ack from Neelakanta and Hung
Arch Built Started Linux distro
-------------------------------------------
mips n n
mips64 n n
x86 n n
x86_64 n n
powerpc n n
powerpc64 n n
Reviewer Checklist:
-------------------
[Submitters: make sure that your review doesn't trigger any checkmarks!]
Your checkin has not passed review because (see checked entries):
___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.
___ You have failed to nominate the proper persons for review and push.
___ Your patches do not have proper short+long header
___ You have grammar/spelling in your header that is unacceptable.
___ You have exceeded a sensible line length in your headers/comments/text.
___ You have failed to put in a proper Trac Ticket # into your commits.
___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)
___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.
___ You have ^M present in some of your files. These have to be removed.
___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.
___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.
___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.
___ You have extraneous garbage in your review (merge commits etc)
___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.
___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.
___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.
___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.
___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)
___ Your computer have a badly configured date and time; confusing the
the threaded patch review.
___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.
___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.
|
|
From: Zoran M. <zor...@er...> - 2016-03-04 13:17:28
|
Summary: imm: add check for SC absence and 2PBE in cold sync for IMMD [#1691]
Review request for Trac Ticket(s): 1691
Peer Reviewer(s): Neelakanta and Hung
Pull request to: Zoran or Hung
Affected branch(es): default(5.0)
Development branch: default(5.0)
--------------------------------
Impacted area Impact y/n
--------------------------------
Docs n
Build system n
RPM/packaging n
Configuration files n
Startup scripts n
SAF services y
OpenSAF services n
Core libraries n
Samples n
Tests n
Other n
Comments (indicate scope for each "y" above):
---------------------------------------------
changeset 2e661e84773c2c78625fa148221d7e3e51b6e9ca
Author: Zoran Milinkovic <zor...@er...>
Date: Fri, 04 Mar 2016 14:13:35 +0100
imm: add check for SC absence and 2PBE in cold sync for IMMD [#1691]
SC absence allowed part will prevent that controllers don't have different
SC absence allowed configuration. When 2PBE or SC absence allowed
misconfiguration on controllers is detected, IMMD will exit in cold sync.
Complete diffstat:
------------------
osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
osaf/services/saf/immsv/immd/immd_evt.c | 3 ---
osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 56 insertions(+), 5 deletions(-)
Testing Commands:
-----------------
Testing, Expected Results:
--------------------------
Test cluster restart and SCs restart with different SC absence allowed and 2PBE configuration
Conditions of Submission:
-------------------------
Ack from Hung and Neelakanta
Arch Built Started Linux distro
-------------------------------------------
mips n n
mips64 n n
x86 n n
x86_64 n n
powerpc n n
powerpc64 n n
Reviewer Checklist:
-------------------
[Submitters: make sure that your review doesn't trigger any checkmarks!]
Your checkin has not passed review because (see checked entries):
___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.
___ You have failed to nominate the proper persons for review and push.
___ Your patches do not have proper short+long header
___ You have grammar/spelling in your header that is unacceptable.
___ You have exceeded a sensible line length in your headers/comments/text.
___ You have failed to put in a proper Trac Ticket # into your commits.
___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)
___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.
___ You have ^M present in some of your files. These have to be removed.
___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.
___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.
___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.
___ You have extraneous garbage in your review (merge commits etc)
___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.
___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.
___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.
___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.
___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)
___ Your computer have a badly configured date and time; confusing the
the threaded patch review.
___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.
___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.
|
|
From: Zoran M. <zor...@er...> - 2016-03-04 13:17:30
|
osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
osaf/services/saf/immsv/immd/immd_evt.c | 3 -
osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
3 files changed, 56 insertions(+), 5 deletions(-)
SC absence allowed part will prevent that controllers don't have different SC absence allowed configuration.
When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
--- a/osaf/services/saf/immsv/immd/immd_cb.h
+++ b/osaf/services/saf/immsv/immd/immd_cb.h
@@ -39,7 +39,7 @@
IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
#define IMMSV_IMMD_MBCSV_VERSION_MIN 4
-#define IMMSV_IMMD_MBCSV_VERSION 4
+#define IMMSV_IMMD_MBCSV_VERSION 5
typedef struct immd_saved_fevs_msg {
IMMSV_FEVS fevsMsg;
diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
--- a/osaf/services/saf/immsv/immd/immd_evt.c
+++ b/osaf/services/saf/immsv/immd/immd_evt.c
@@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
if(cb->mIs2Pbe) {
/* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
- } else {
- /* 1PBE or 0PBE joining SC must sync */
- accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
}
}
} else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
--- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
+++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
@@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
TRACE_ENTER();
uint32_t rc = NCSCC_RC_SUCCESS;
uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
- uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
+ uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
+ uint16_t peer_version;
/* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
if (cb->ha_state == SA_AMF_HA_STANDBY) {
@@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
return rc;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
/* First reserve space to store the number of X that will be sent */
header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
@@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
ncs_encode_8bit(&uns8_ptr, 0x0);
+ if(peer_version >= 5) {
+ uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ osafassert(uns8_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
+
+ uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ osafassert(uns16_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
+ }
+
/* Alter this to follow same pattern as logsv */
if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
@@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
{
uint8_t *ptr, num_fevs, continue_marker, data[16];
uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
+ uint16_t peer_version;
TRACE_ENTER();
TRACE_5("RECEIVED COLD SYNC MESSAGE");
@@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
return NCSCC_RC_SUCCESS;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
+ if(cb->mScAbsenceAllowed && peer_version < 5) {
+ LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
+ exit(1);
+ }
+
/* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
num_fevs = ncs_decode_8bit(&ptr);
@@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
}
+ if(peer_version >= 5) {
+ uint8_t is2Pbe;
+ uint16_t scAbsenceAllowed;
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
+ is2Pbe = ncs_decode_8bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
+
+ if(cb->mIs2Pbe && !is2Pbe) {
+ LOG_ER("2PBE is disabled on active IMMD. Exiting.");
+ exit(1);
+ }
+ if(!cb->mIs2Pbe && is2Pbe) {
+ LOG_ER("2PBE is enabled on active IMMD. Exiting.");
+ exit(1);
+ }
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
+ scAbsenceAllowed = ncs_decode_16bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
+
+ if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
+ LOG_ER("SC absence allowed in not the same as on active IMMD. "
+ "Active: %u, Standby: %d. Exiting.",
+ scAbsenceAllowed, cb->mScAbsenceAllowed);
+ exit(1);
+ }
+ }
+
TRACE_LEAVE();
return rc;
}
|
|
From: Zoran M. <zor...@er...> - 2016-03-01 10:09:12
|
osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
osaf/services/saf/immsv/immd/immd_evt.c | 3 -
osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
3 files changed, 56 insertions(+), 5 deletions(-)
SC absence allowed part will prevent that controllers don't have different SC absence configuration.
When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
After few times restarting due to SC absence or 2PBE misconfiguration, AMF will reboot the node.
diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
--- a/osaf/services/saf/immsv/immd/immd_cb.h
+++ b/osaf/services/saf/immsv/immd/immd_cb.h
@@ -39,7 +39,7 @@
IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
#define IMMSV_IMMD_MBCSV_VERSION_MIN 4
-#define IMMSV_IMMD_MBCSV_VERSION 4
+#define IMMSV_IMMD_MBCSV_VERSION 5
typedef struct immd_saved_fevs_msg {
IMMSV_FEVS fevsMsg;
diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
--- a/osaf/services/saf/immsv/immd/immd_evt.c
+++ b/osaf/services/saf/immsv/immd/immd_evt.c
@@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
if(cb->mIs2Pbe) {
/* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
- } else {
- /* 1PBE or 0PBE joining SC must sync */
- accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
}
}
} else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
--- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
+++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
@@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
TRACE_ENTER();
uint32_t rc = NCSCC_RC_SUCCESS;
uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
- uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
+ uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
+ uint16_t peer_version;
/* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
if (cb->ha_state == SA_AMF_HA_STANDBY) {
@@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
return rc;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
/* First reserve space to store the number of X that will be sent */
header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
@@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
ncs_encode_8bit(&uns8_ptr, 0x0);
+ if(peer_version >= 5) {
+ uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ osafassert(uns8_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
+
+ uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ osafassert(uns16_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
+ }
+
/* Alter this to follow same pattern as logsv */
if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
@@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
{
uint8_t *ptr, num_fevs, continue_marker, data[16];
uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
+ uint16_t peer_version;
TRACE_ENTER();
TRACE_5("RECEIVED COLD SYNC MESSAGE");
@@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
return NCSCC_RC_SUCCESS;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
+ if(cb->mScAbsenceAllowed && peer_version < 5) {
+ LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
+ exit(1);
+ }
+
/* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
num_fevs = ncs_decode_8bit(&ptr);
@@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
}
+ if(peer_version >= 5) {
+ uint8_t is2Pbe;
+ uint16_t scAbsenceAllowed;
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
+ is2Pbe = ncs_decode_8bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
+
+ if(cb->mIs2Pbe && !is2Pbe) {
+ LOG_ER("2PBE is disabled on active IMMD. Exiting.");
+ exit(1);
+ }
+ if(!cb->mIs2Pbe && is2Pbe) {
+ LOG_ER("2PBE is enabled on active IMMD. Exiting.");
+ exit(1);
+ }
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
+ scAbsenceAllowed = ncs_decode_16bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
+
+ if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
+ LOG_ER("SC absence allowed in not the same as on active IMMD. "
+ "Active: %u, Standby: %d. Exiting.",
+ scAbsenceAllowed, cb->mScAbsenceAllowed);
+ exit(1);
+ }
+ }
+
TRACE_LEAVE();
return rc;
}
|
|
From: Hung N. <hun...@de...> - 2016-03-02 07:03:16
|
Hi Zoran,
Reviewed the patches.
Ack for the series.
BR,
Hung Nguyen - DEK Technologies
--------------------------------------------------------------------------------
From: Zoran Milinkovic zor...@er...
Sent: Tuesday, March 01, 2016 5:09PM
To: Neelakanta Reddy
red...@or...
Cc: Opensaf-devel
ope...@li...
Subject: [devel] [PATCH 1 of 1] imm: add check for SC absence and 2PBE in cold sync for IMMD [#1625]
osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
osaf/services/saf/immsv/immd/immd_evt.c | 3 -
osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
3 files changed, 56 insertions(+), 5 deletions(-)
SC absence allowed part will prevent that controllers don't have different SC absence configuration.
When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
After few times restarting due to SC absence or 2PBE misconfiguration, AMF will reboot the node.
diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
--- a/osaf/services/saf/immsv/immd/immd_cb.h
+++ b/osaf/services/saf/immsv/immd/immd_cb.h
@@ -39,7 +39,7 @@
IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
#define IMMSV_IMMD_MBCSV_VERSION_MIN 4
-#define IMMSV_IMMD_MBCSV_VERSION 4
+#define IMMSV_IMMD_MBCSV_VERSION 5
typedef struct immd_saved_fevs_msg {
IMMSV_FEVS fevsMsg;
diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
--- a/osaf/services/saf/immsv/immd/immd_evt.c
+++ b/osaf/services/saf/immsv/immd/immd_evt.c
@@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
if(cb->mIs2Pbe) {
/* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
- } else {
- /* 1PBE or 0PBE joining SC must sync */
- accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
}
}
} else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
--- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
+++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
@@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
TRACE_ENTER();
uint32_t rc = NCSCC_RC_SUCCESS;
uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
- uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
+ uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
+ uint16_t peer_version;
/* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
if (cb->ha_state == SA_AMF_HA_STANDBY) {
@@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
return rc;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
/* First reserve space to store the number of X that will be sent */
header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
@@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
ncs_encode_8bit(&uns8_ptr, 0x0);
+ if(peer_version >= 5) {
+ uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ osafassert(uns8_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
+ ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
+
+ uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ osafassert(uns16_ptr);
+ ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
+ ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
+ }
+
/* Alter this to follow same pattern as logsv */
if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
@@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
{
uint8_t *ptr, num_fevs, continue_marker, data[16];
uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
+ uint16_t peer_version;
TRACE_ENTER();
TRACE_5("RECEIVED COLD SYNC MESSAGE");
@@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
return NCSCC_RC_SUCCESS;
}
+ peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
+ IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
+
+ if(cb->mScAbsenceAllowed && peer_version < 5) {
+ LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
+ exit(1);
+ }
+
/* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
num_fevs = ncs_decode_8bit(&ptr);
@@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
}
+ if(peer_version >= 5) {
+ uint8_t is2Pbe;
+ uint16_t scAbsenceAllowed;
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
+ is2Pbe = ncs_decode_8bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
+
+ if(cb->mIs2Pbe && !is2Pbe) {
+ LOG_ER("2PBE is disabled on active IMMD. Exiting.");
+ exit(1);
+ }
+ if(!cb->mIs2Pbe && is2Pbe) {
+ LOG_ER("2PBE is enabled on active IMMD. Exiting.");
+ exit(1);
+ }
+
+ ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
+ scAbsenceAllowed = ncs_decode_16bit(&ptr);
+ ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
+
+ if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
+ LOG_ER("SC absence allowed in not the same as on active IMMD. "
+ "Active: %u, Standby: %d. Exiting.",
+ scAbsenceAllowed, cb->mScAbsenceAllowed);
+ exit(1);
+ }
+ }
+
TRACE_LEAVE();
return rc;
}
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Opensaf-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/opensaf-devel
|
|
From: Neelakanta R. <red...@or...> - 2016-03-07 12:58:40
|
Hi Zoran,
Reviewed and tested the patch.
The approach is good,the similar defect must exit for 2PBE from Opensaf4.4.
I suggest, to have MBCSV_VERSION 5 for 2PBE
and MBCSV_VERSION 6 for scabsence.
Either have a new defect for 2PBE or open a new defect.
First 2PBE patch should go and on top of 2PBE patch scabsence patch
should follow.
Thanks,
Neel./
On Tuesday 01 March 2016 03:39 PM, Zoran Milinkovic wrote:
> osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
> osaf/services/saf/immsv/immd/immd_evt.c | 3 -
> osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
> 3 files changed, 56 insertions(+), 5 deletions(-)
>
>
> SC absence allowed part will prevent that controllers don't have different SC absence configuration.
> When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
>
> After few times restarting due to SC absence or 2PBE misconfiguration, AMF will reboot the node.
>
> diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
> --- a/osaf/services/saf/immsv/immd/immd_cb.h
> +++ b/osaf/services/saf/immsv/immd/immd_cb.h
> @@ -39,7 +39,7 @@
> IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
>
> #define IMMSV_IMMD_MBCSV_VERSION_MIN 4
> -#define IMMSV_IMMD_MBCSV_VERSION 4
> +#define IMMSV_IMMD_MBCSV_VERSION 5
>
> typedef struct immd_saved_fevs_msg {
> IMMSV_FEVS fevsMsg;
> diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
> --- a/osaf/services/saf/immsv/immd/immd_evt.c
> +++ b/osaf/services/saf/immsv/immd/immd_evt.c
> @@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
> if(cb->mIs2Pbe) {
> /* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
> accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
> - } else {
> - /* 1PBE or 0PBE joining SC must sync */
> - accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
> }
> }
> } else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
> diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> --- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
> +++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> @@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> TRACE_ENTER();
> uint32_t rc = NCSCC_RC_SUCCESS;
> uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
> - uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
> + uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
> + uint16_t peer_version;
>
> /* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
> if (cb->ha_state == SA_AMF_HA_STANDBY) {
> @@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> return rc;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> /* First reserve space to store the number of X that will be sent */
>
> header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> @@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> ncs_encode_8bit(&uns8_ptr, 0x0);
>
> + if(peer_version >= 5) {
> + uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + osafassert(uns8_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
> +
> + uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + osafassert(uns16_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
> + }
> +
> /* Alter this to follow same pattern as logsv */
> if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
> if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
> @@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> {
> uint8_t *ptr, num_fevs, continue_marker, data[16];
> uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
> + uint16_t peer_version;
>
> TRACE_ENTER();
> TRACE_5("RECEIVED COLD SYNC MESSAGE");
> @@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> return NCSCC_RC_SUCCESS;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> + if(cb->mScAbsenceAllowed && peer_version < 5) {
> + LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
> + exit(1);
> + }
> +
> /* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
> ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> num_fevs = ncs_decode_8bit(&ptr);
> @@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> }
>
> + if(peer_version >= 5) {
> + uint8_t is2Pbe;
> + uint16_t scAbsenceAllowed;
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> + is2Pbe = ncs_decode_8bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> +
> + if(cb->mIs2Pbe && !is2Pbe) {
> + LOG_ER("2PBE is disabled on active IMMD. Exiting.");
> + exit(1);
> + }
> + if(!cb->mIs2Pbe && is2Pbe) {
> + LOG_ER("2PBE is enabled on active IMMD. Exiting.");
> + exit(1);
> + }
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
> + scAbsenceAllowed = ncs_decode_16bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
> +
> + if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
> + LOG_ER("SC absence allowed in not the same as on active IMMD. "
> + "Active: %u, Standby: %d. Exiting.",
> + scAbsenceAllowed, cb->mScAbsenceAllowed);
> + exit(1);
> + }
> + }
> +
> TRACE_LEAVE();
> return rc;
> }
|
|
From: Neelakanta R. <red...@or...> - 2016-03-07 12:58:54
|
Hi Zoran,
Reviewed and tested the patch.
The approach is good,the similar defect must exit for 2PBE from Opensaf4.4.
I suggest, to have MBCSV_VERSION 5 for 2PBE
and MBCSV_VERSION 6 for scabsence.
Either have a new defect for 2PBE or open a new defect.
First 2PBE patch should go and on top of 2PBE patch scabsence patch
should follow.
Thanks,
Neel.
On Tuesday 01 March 2016 03:39 PM, Zoran Milinkovic wrote:
> osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
> osaf/services/saf/immsv/immd/immd_evt.c | 3 -
> osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
> 3 files changed, 56 insertions(+), 5 deletions(-)
>
>
> SC absence allowed part will prevent that controllers don't have different SC absence configuration.
> When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
>
> After few times restarting due to SC absence or 2PBE misconfiguration, AMF will reboot the node.
>
> diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
> --- a/osaf/services/saf/immsv/immd/immd_cb.h
> +++ b/osaf/services/saf/immsv/immd/immd_cb.h
> @@ -39,7 +39,7 @@
> IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
>
> #define IMMSV_IMMD_MBCSV_VERSION_MIN 4
> -#define IMMSV_IMMD_MBCSV_VERSION 4
> +#define IMMSV_IMMD_MBCSV_VERSION 5
>
> typedef struct immd_saved_fevs_msg {
> IMMSV_FEVS fevsMsg;
> diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
> --- a/osaf/services/saf/immsv/immd/immd_evt.c
> +++ b/osaf/services/saf/immsv/immd/immd_evt.c
> @@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
> if(cb->mIs2Pbe) {
> /* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
> accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
> - } else {
> - /* 1PBE or 0PBE joining SC must sync */
> - accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
> }
> }
> } else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
> diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> --- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
> +++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> @@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> TRACE_ENTER();
> uint32_t rc = NCSCC_RC_SUCCESS;
> uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
> - uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
> + uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
> + uint16_t peer_version;
>
> /* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
> if (cb->ha_state == SA_AMF_HA_STANDBY) {
> @@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> return rc;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> /* First reserve space to store the number of X that will be sent */
>
> header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> @@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> ncs_encode_8bit(&uns8_ptr, 0x0);
>
> + if(peer_version >= 5) {
> + uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + osafassert(uns8_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
> +
> + uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + osafassert(uns16_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
> + }
> +
> /* Alter this to follow same pattern as logsv */
> if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
> if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
> @@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> {
> uint8_t *ptr, num_fevs, continue_marker, data[16];
> uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
> + uint16_t peer_version;
>
> TRACE_ENTER();
> TRACE_5("RECEIVED COLD SYNC MESSAGE");
> @@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> return NCSCC_RC_SUCCESS;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> + if(cb->mScAbsenceAllowed && peer_version < 5) {
> + LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
> + exit(1);
> + }
> +
> /* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
> ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> num_fevs = ncs_decode_8bit(&ptr);
> @@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> }
>
> + if(peer_version >= 5) {
> + uint8_t is2Pbe;
> + uint16_t scAbsenceAllowed;
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> + is2Pbe = ncs_decode_8bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> +
> + if(cb->mIs2Pbe && !is2Pbe) {
> + LOG_ER("2PBE is disabled on active IMMD. Exiting.");
> + exit(1);
> + }
> + if(!cb->mIs2Pbe && is2Pbe) {
> + LOG_ER("2PBE is enabled on active IMMD. Exiting.");
> + exit(1);
> + }
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
> + scAbsenceAllowed = ncs_decode_16bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
> +
> + if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
> + LOG_ER("SC absence allowed in not the same as on active IMMD. "
> + "Active: %u, Standby: %d. Exiting.",
> + scAbsenceAllowed, cb->mScAbsenceAllowed);
> + exit(1);
> + }
> + }
> +
> TRACE_LEAVE();
> return rc;
> }
|
|
From: Hung N. <hun...@de...> - 2016-03-08 02:35:12
|
Hi Neel,
I will separate it into a new ticket for 2PBE.
Thanks,
Hung Nguyen - DEK Technologies
--------------------------------------------------------------------------------
From: Neelakanta Reddy red...@or...
Sent: Monday, March 07, 2016 7:59PM
To: Zoran Milinkovic
zor...@er...
Cc: Opensaf-devel
ope...@li...
Subject: Re: [devel] [PATCH 1 of 1] imm: add check for SC absence and 2PBE in cold sync for IMMD [#1625]
Hi Zoran,
Reviewed and tested the patch.
The approach is good,the similar defect must exit for 2PBE from Opensaf4.4.
I suggest, to have MBCSV_VERSION 5 for 2PBE
and MBCSV_VERSION 6 for scabsence.
Either have a new defect for 2PBE or open a new defect.
First 2PBE patch should go and on top of 2PBE patch scabsence patch
should follow.
Thanks,
Neel.
On Tuesday 01 March 2016 03:39 PM, Zoran Milinkovic wrote:
> osaf/services/saf/immsv/immd/immd_cb.h | 2 +-
> osaf/services/saf/immsv/immd/immd_evt.c | 3 -
> osaf/services/saf/immsv/immd/immd_mbcsv.c | 56 ++++++++++++++++++++++++++++++-
> 3 files changed, 56 insertions(+), 5 deletions(-)
>
>
> SC absence allowed part will prevent that controllers don't have different SC absence configuration.
> When 2PBE or SC absence allowed misconfiguration on controllers is detected, IMMD will exit in cold sync.
>
> After few times restarting due to SC absence or 2PBE misconfiguration, AMF will reboot the node.
>
> diff --git a/osaf/services/saf/immsv/immd/immd_cb.h b/osaf/services/saf/immsv/immd/immd_cb.h
> --- a/osaf/services/saf/immsv/immd/immd_cb.h
> +++ b/osaf/services/saf/immsv/immd/immd_cb.h
> @@ -39,7 +39,7 @@
> IMMD_WRT_IMMND_SUBPART_VER_MIN + 1 )
>
> #define IMMSV_IMMD_MBCSV_VERSION_MIN 4
> -#define IMMSV_IMMD_MBCSV_VERSION 4
> +#define IMMSV_IMMD_MBCSV_VERSION 5
>
> typedef struct immd_saved_fevs_msg {
> IMMSV_FEVS fevsMsg;
> diff --git a/osaf/services/saf/immsv/immd/immd_evt.c b/osaf/services/saf/immsv/immd/immd_evt.c
> --- a/osaf/services/saf/immsv/immd/immd_evt.c
> +++ b/osaf/services/saf/immsv/immd/immd_evt.c
> @@ -721,9 +721,6 @@ static void immd_accept_node(IMMD_CB *cb
> if(cb->mIs2Pbe) {
> /* 2PBE is true => joining SC must sync AND get informed of 2PBE. */
> accept_evt.info.immnd.info.ctrl.canBeCoord = 3;
> - } else {
> - /* 1PBE or 0PBE joining SC must sync */
> - accept_evt.info.immnd.info.ctrl.canBeCoord = (node_info->isOnController)?1:(cb->mScAbsenceAllowed)?4:0;
> }
> }
> } else if(cb->immnd_coord == 0 && cb->mScAbsenceAllowed && knownVeteran) {
> diff --git a/osaf/services/saf/immsv/immd/immd_mbcsv.c b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> --- a/osaf/services/saf/immsv/immd/immd_mbcsv.c
> +++ b/osaf/services/saf/immsv/immd/immd_mbcsv.c
> @@ -628,7 +628,8 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> TRACE_ENTER();
> uint32_t rc = NCSCC_RC_SUCCESS;
> uint8_t *header, num_fevs = 0, *sync_cnt_ptr;
> - uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr;
> + uint8_t *uns32_ptr, *uns64_ptr, *uns8_ptr, *uns16_ptr;
> + uint16_t peer_version;
>
> /* COLD_SYNC_RESP IS DONE BY THE ACTIVE */
> if (cb->ha_state == SA_AMF_HA_STANDBY) {
> @@ -644,6 +645,9 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> return rc;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.encode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> /* First reserve space to store the number of X that will be sent */
>
> header = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> @@ -759,6 +763,18 @@ static uint32_t mbcsv_enc_msg_resp(IMMD_
> ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> ncs_encode_8bit(&uns8_ptr, 0x0);
>
> + if(peer_version >= 5) {
> + uns8_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + osafassert(uns8_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint8_t));
> + ncs_encode_8bit(&uns8_ptr, cb->mIs2Pbe);
> +
> + uns16_ptr = ncs_enc_reserve_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + osafassert(uns16_ptr);
> + ncs_enc_claim_space(&arg->info.encode.io_uba, sizeof(uint16_t));
> + ncs_encode_16bit(&uns16_ptr, cb->mScAbsenceAllowed);
> + }
> +
> /* Alter this to follow same pattern as logsv */
> if (num_fevs < IMMD_MBCSV_MAX_MSG_CNT) {
> if (arg->info.encode.io_msg_type == NCS_MBCSV_MSG_COLD_SYNC_RESP) {
> @@ -1030,6 +1046,7 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> {
> uint8_t *ptr, num_fevs, continue_marker, data[16];
> uint32_t count = 0, rc = NCSCC_RC_SUCCESS;
> + uint16_t peer_version;
>
> TRACE_ENTER();
> TRACE_5("RECEIVED COLD SYNC MESSAGE");
> @@ -1039,6 +1056,14 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> return NCSCC_RC_SUCCESS;
> }
>
> + peer_version = m_NCS_MBCSV_FMT_GET(arg->info.decode.i_peer_version,
> + IMMSV_IMMD_MBCSV_VERSION, IMMSV_IMMD_MBCSV_VERSION_MIN);
> +
> + if(cb->mScAbsenceAllowed && peer_version < 5) {
> + LOG_ER("SC absence allowed is allowed on standby IMMD. Active IMMD is not from OpenSAF 5.0 or above. Exiting.");
> + exit(1);
> + }
> +
> /* 1. Decode the 1st uint8_t region , to get the num of fevs msgs to sync */
> ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> num_fevs = ncs_decode_8bit(&ptr);
> @@ -1140,6 +1165,35 @@ static uint32_t mbcsv_dec_sync_resp(IMMD
> ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> }
>
> + if(peer_version >= 5) {
> + uint8_t is2Pbe;
> + uint16_t scAbsenceAllowed;
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint8_t));
> + is2Pbe = ncs_decode_8bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint8_t));
> +
> + if(cb->mIs2Pbe && !is2Pbe) {
> + LOG_ER("2PBE is disabled on active IMMD. Exiting.");
> + exit(1);
> + }
> + if(!cb->mIs2Pbe && is2Pbe) {
> + LOG_ER("2PBE is enabled on active IMMD. Exiting.");
> + exit(1);
> + }
> +
> + ptr = ncs_dec_flatten_space(&arg->info.decode.i_uba, data, sizeof(uint16_t));
> + scAbsenceAllowed = ncs_decode_16bit(&ptr);
> + ncs_dec_skip_space(&arg->info.decode.i_uba, sizeof(uint16_t));
> +
> + if(cb->mScAbsenceAllowed != scAbsenceAllowed) {
> + LOG_ER("SC absence allowed in not the same as on active IMMD. "
> + "Active: %u, Standby: %d. Exiting.",
> + scAbsenceAllowed, cb->mScAbsenceAllowed);
> + exit(1);
> + }
> + }
> +
> TRACE_LEAVE();
> return rc;
> }
------------------------------------------------------------------------------
Transform Data into Opportunity.
Accelerate data analysis in your applications with
Intel Data Analytics Acceleration Library.
Click to learn more.
http://makebettercode.com/inteldaal-eval
_______________________________________________
Opensaf-devel mailing list
Ope...@li...
https://lists.sourceforge.net/lists/listinfo/opensaf-devel
|