[devel] [PATCH 1 of 1] imm: Create missing IMMND node when processing intro messages [#1955]

2016-08-27 Thread Hung Nguyen
 osaf/services/saf/immsv/immd/immd_evt.c |  91 ++--
 osaf/services/saf/immsv/immd/immd_mds.c |   3 +
 2 files changed, 44 insertions(+), 50 deletions(-)


There's no guarantee in order of service event and intro message from IMMND.

When processing intro message, if fail to get the IMMND node, we will add the 
IMMND node to the immnd_tree list.
Later when the service event comes, it will do nothing as the IMMND node has 
already been added.

Prior to this patch, any intro message comes before service event will be 
droppped,
and the IMMND will have to resend the intro message (after 5 seconds for new 
IMMND, after 1 second for veteran IMMND).

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
@@ -855,6 +855,36 @@ static void immd_accept_node(IMMD_CB *cb
TRACE_LEAVE();
 }
 
+static IMMD_IMMND_INFO_NODE* immd_add_immnd_node(IMMD_CB *cb, MDS_DEST dest) {
+   bool add_flag = true;
+   IMMD_IMMND_INFO_NODE* node_info;
+
+   immd_immnd_info_node_find_add(>immnd_tree, , _info, 
_flag);
+   if (!node_info) {
+   LOG_ER("Failed to add IMMND node dest %" PRIu64, dest);
+   return NULL;
+   }
+
+   if (add_flag) {
+   TRACE("IMMND node has already been added, dest %" PRIu64, dest);
+   return node_info;
+   }
+
+   if (m_IMMND_IS_ON_SCXB(cb->immd_self_id, 
immd_get_slot_and_subslot_id_from_mds_dest(dest))) {
+   TRACE_5("Added local IMMND");
+   cb->is_loc_immnd_up = true;
+   cb->loc_immnd_dest = dest;
+   } else if (m_IMMND_IS_ON_SCXB(cb->immd_remote_id, 
immd_get_slot_and_subslot_id_from_mds_dest(dest))) {
+   TRACE_5("Added remote IMMND - node_id:%x", 
m_NCS_NODE_ID_FROM_MDS_DEST(dest));
+   cb->is_rem_immnd_up = true;
+   cb->rem_immnd_dest = dest;
+   }
+
+   LOG_IN("Added IMMND node with dest %" PRIu64, dest);
+
+   return node_info;
+}
+
 /
  * Name  : immd_evt_proc_immnd_announce_dump
  *
@@ -1358,9 +1388,12 @@ static uint32_t immd_evt_proc_immnd_intr
 
immd_immnd_info_node_get(>immnd_tree, >dest, _info);
if (!node_info) {
-   LOG_WA("Node not found %" PRIu64, sinfo->dest);
-   proc_rc = NCSCC_RC_FAILURE;
-   goto done;
+   LOG_WA("Node not found dest %" PRIu64 ", add the missing IMMND 
node", sinfo->dest);
+   node_info = immd_add_immnd_node(cb, sinfo->dest);
+   if (!node_info) {
+   proc_rc = NCSCC_RC_FAILURE;
+   goto done;
+   }
}
 
oldPid = node_info->immnd_execPid;
@@ -2605,14 +2638,10 @@ static uint32_t immd_evt_proc_mds_evt(IM
 {
IMMSV_MDS_INFO *mds_info;
IMMD_IMMND_INFO_NODE *node_info = NULL;
-   bool add_flag = true;
-   uint32_t phy_slot_sub_slot;
TRACE_ENTER();
 
mds_info = >info.mds_info;
 
-   memset(_slot_sub_slot, 0, sizeof(uint32_t));
-
if (mds_info->svc_id == NCSMDS_SVC_ID_IMMND)
TRACE_5("Received IMMND service event");
else if (mds_info->svc_id == NCSMDS_SVC_ID_IMMD)
@@ -2705,51 +2734,13 @@ static uint32_t immd_evt_proc_mds_evt(IM
}
 
if (mds_info->svc_id == NCSMDS_SVC_ID_IMMND) {
-   phy_slot_sub_slot = 
immd_get_slot_and_subslot_id_from_mds_dest(mds_info->dest);
-   immd_immnd_info_node_find_add(>immnd_tree, 
_info->dest, _info, _flag);
-   LOG_IN("node with dest ADDED %" PRIu64, mds_info->dest);
-
-   if (m_IMMND_IS_ON_SCXB(cb->immd_self_id,
-  
immd_get_slot_and_subslot_id_from_mds_dest(mds_info->dest))) {
-   TRACE_5("NCSMDS_UP for IMMND local");
-   cb->is_loc_immnd_up = true;
-   cb->loc_immnd_dest = mds_info->dest;
-   if (cb->ha_state == SA_AMF_HA_ACTIVE) {
-   TRACE_5("NCSMDS_UP IMMND THIS IMMD is 
ACTIVE");
-   }
+   if (cb->ha_state == SA_AMF_HA_ACTIVE) {
+   TRACE_5("NCSMDS_UP and this IMMD is ACTIVE");
+   } else if (cb->ha_state == SA_AMF_HA_STANDBY) {
+   TRACE_5("NCSMDS_UP and this IMMD is STANDBY");
}
 
-   /* When IMMND ON STANDBY COMES UP */
-   if (m_IMMND_IS_ON_SCXB(cb->immd_remote_id,
-  
immd_get_slot_and_subslot_id_from_mds_dest(mds_info->dest))) {
-   

[devel] [PATCH 0 of 1] Review Request for imm: Create missing IMMND node when processing intro messages [#1955]

2016-08-27 Thread Hung Nguyen
Summary: imm: Create missing IMMND node when processing intro messages [#1955]
Review request for Trac Ticket(s): 1955
Peer Reviewer(s): Zoran, Neel
Pull request to:
Affected branch(es): 5.0, 5.1
Development branch: 5.1


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-


changeset 97d4ba9aa9a769d8444b61547c0157bec0fc575c
Author: Hung Nguyen 
Date:   Sun, 28 Aug 2016 10:47:22 +0700

imm: Create missing IMMND node when processing intro messages [#1955]

There's no guarantee in order of service event and intro message from 
IMMND.

When processing intro message, if fail to get the IMMND node, we will 
add
the IMMND node to the immnd_tree list. Later when the service event 
comes,
it will do nothing as the IMMND node has already been added.

Prior to this patch, any intro message comes before service event will 
be
droppped, and the IMMND will have to resend the intro message (after 5
seconds for new IMMND, after 1 second for veteran IMMND).


Complete diffstat:
--
 osaf/services/saf/immsv/immd/immd_evt.c |  91 
+--
 osaf/services/saf/immsv/immd/immd_mds.c |   3 +++
 2 files changed, 44 insertions(+), 50 deletions(-)


Testing Commands:
-



Testing, Expected Results:
--



Conditions of Submission:
-
Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  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.


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


[devel] [PATCH 1 of 1] imm: Avoid jobDurationSec of zero [#1704]

2016-08-27 Thread Hung Nguyen
 osaf/services/saf/immsv/immnd/immnd_proc.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Avoid jobDurationSec of zero.

diff --git a/osaf/services/saf/immsv/immnd/immnd_proc.c 
b/osaf/services/saf/immsv/immnd/immnd_proc.c
--- a/osaf/services/saf/immsv/immnd/immnd_proc.c
+++ b/osaf/services/saf/immsv/immnd/immnd_proc.c
@@ -1668,6 +1668,7 @@ uint32_t immnd_proc_server(uint32_t *tim
osaf_timespec_subtract(, >mJobStart, );
SaUint32T jobDurationSec = (SaUint32T) jobDurationTs.tv_sec;
SaBoolT pbeImmndDeadlock=SA_FALSE;
+   if(!jobDurationSec) {++jobDurationSec;} /* Avoid jobDurationSec of zero 
*/
/*TRACE_ENTER(); */
 
if ((cb->mStep % printFrq) == 0) {

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


[devel] [PATCH 0 of 1] Review Request for imm: Avoid jobDurationSec of zero [#1704]

2016-08-27 Thread Hung Nguyen
Summary: imm: Avoid jobDurationSec of zero [#1704]
Review request for Trac Ticket(s): 1704
Peer Reviewer(s): Zoran, Neel
Pull request to:
Affected branch(es): 5.1
Development branch: 5.1


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-


changeset eb92c2671a90e50b17421a7601486b59c9aa46cc
Author: Hung Nguyen 
Date:   Sun, 28 Aug 2016 09:28:34 +0700

imm: Avoid jobDurationSec of zero [#1704]

Avoid jobDurationSec of zero.


Complete diffstat:
--
 osaf/services/saf/immsv/immnd/immnd_proc.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)


Testing Commands:
-



Testing, Expected Results:
--



Conditions of Submission:
-
Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  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.


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


[devel] [PATCH 0 of 1] Review Request for smfd: Merge rolling to singlestep procedures for several nodes [#1685]

2016-08-27 Thread Rafael Odzakow
Summary: smfd: Merge rolling to singlestep procedures for several nodes
Review request for Trac Ticket(s): #1685
Peer Reviewer(s): lennart, reddy
Pull request to: <>
Affected branch(es): <>
Development branch: <>


Impacted area   Impact y/n

 Docsn
 Build systemn
 RPM/packaging   n
 Configuration files n
 Startup scripts n
 SAF servicesy
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   n
 Other   n


Comments (indicate scope for each "y" above):
-
 Missing the si-swap implementation and OI for some extra checks.

changeset a383f0ebdb5602d9799ee69f3bdf59e479413fb9
Author: Rafael Odzakow 
Date:   Tue, 23 Aug 2016 10:02:51 +0200

smfd: Merge rolling to singlestep procedures for several nodes [#1685]

Enables the balanced mode feature. This mode changes the execution
of rolling procedures to be merged into one or several single steps that are
spread out across the cluster nodes. This feature is used to give a faster
upgrade time compared to rolling one node at a time, possibly several times
for each node. By splittting the procedures it into several single steps
across the nodes a total service outage can be avoided.

Added Files:

 osaf/services/saf/smfsv/smfd/SmfExecControl.cc
 osaf/services/saf/smfsv/smfd/SmfExecControl.h


Complete diffstat:
--
 osaf/services/saf/smfsv/config/smfsv_classes.xml|   13 +
 osaf/services/saf/smfsv/smfd/Makefile.am|6 +-
 osaf/services/saf/smfsv/smfd/SmfCampState.cc|  126 
--
 osaf/services/saf/smfsv/smfd/SmfCampaign.cc |   78 
++
 osaf/services/saf/smfsv/smfd/SmfCampaign.hh |1 +
 osaf/services/saf/smfsv/smfd/SmfExecControl.cc  |  423 
+++
 osaf/services/saf/smfsv/smfd/SmfExecControl.h   |   64 
+
 osaf/services/saf/smfsv/smfd/SmfProcState.cc|7 ++-
 osaf/services/saf/smfsv/smfd/SmfUpgradeCampaign.cc  |   32 +++-
 osaf/services/saf/smfsv/smfd/SmfUpgradeCampaign.hh  |   24 -
 osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc |   14 +++--
 osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.hh |   20 ++-
 osaf/services/saf/smfsv/smfd/SmfUpgradeStep.hh  |   13 ++--
 osaf/services/saf/smfsv/smfd/smfd.h |2 +-
 14 files changed, 638 insertions(+), 185 deletions(-)


Testing Commands:
-
 Campaign with rolling procedures is attached to the ticket. Run a campaign
 with rolling procedures on payloads and enable the balanced mode. Example
 configuration for balanced mode:

 immcfg -c OpenSafSmfExecControl -a procExecMode=2 
openSafSmfExecControl=MergeCampToSS2o
 immcfg -a numberOfSingleSteps=2 -a nodesForSingleStep=PL-3 -a 
nodesForSingleStep=PL-4 openSafSmfExecControl=MergeCampToSS2
 immcfg -a openSafSmfExecControl=openSafSmfExecControl=MergeCampToSS2 
smfConfig=1,safApp=safSmfService

 In this configuration we can expect to run one single step procedures on each 
of the payloads specified


Testing, Expected Results:
--
 campaign should have executed all steps.


Conditions of Submission:
-
 <>


Arch  Built StartedLinux distro
---
mipsn  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 

[devel] [PATCH 1 of 1] smfd: Merge rolling to singlestep procedures for several nodes [#1685]

2016-08-27 Thread Rafael Odzakow
 osaf/services/saf/smfsv/config/smfsv_classes.xml|   13 +
 osaf/services/saf/smfsv/smfd/Makefile.am|6 +-
 osaf/services/saf/smfsv/smfd/SmfCampState.cc|  126 +
 osaf/services/saf/smfsv/smfd/SmfCampaign.cc |   78 ++-
 osaf/services/saf/smfsv/smfd/SmfCampaign.hh |1 +
 osaf/services/saf/smfsv/smfd/SmfExecControl.cc  |  423 
 osaf/services/saf/smfsv/smfd/SmfExecControl.h   |   64 +++
 osaf/services/saf/smfsv/smfd/SmfProcState.cc|7 +-
 osaf/services/saf/smfsv/smfd/SmfUpgradeCampaign.cc  |   32 +-
 osaf/services/saf/smfsv/smfd/SmfUpgradeCampaign.hh  |   24 +-
 osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.cc |   14 +-
 osaf/services/saf/smfsv/smfd/SmfUpgradeProcedure.hh |   20 +-
 osaf/services/saf/smfsv/smfd/SmfUpgradeStep.hh  |   13 +-
 osaf/services/saf/smfsv/smfd/smfd.h |2 +-
 14 files changed, 638 insertions(+), 185 deletions(-)


diff --git a/osaf/services/saf/smfsv/config/smfsv_classes.xml 
b/osaf/services/saf/smfsv/config/smfsv_classes.xml
--- a/osaf/services/saf/smfsv/config/smfsv_classes.xml
+++ b/osaf/services/saf/smfsv/config/smfsv_classes.xml
@@ -531,5 +531,18 @@
SA_WRITABLE
0

+   
+   numberOfSingleSteps
+   SA_UINT32_T
+   SA_CONFIG
+   SA_WRITABLE
+   
+   
+   nodesForSingleStep
+   SA_STRING_T
+   SA_CONFIG
+  SA_WRITABLE
+   SA_MULTI_VALUE
+   

 
diff --git a/osaf/services/saf/smfsv/smfd/Makefile.am 
b/osaf/services/saf/smfsv/smfd/Makefile.am
--- a/osaf/services/saf/smfsv/smfd/Makefile.am
+++ b/osaf/services/saf/smfsv/smfd/Makefile.am
@@ -49,7 +49,8 @@ noinst_HEADERS = \
SmfCampaignWrapup.hh \
SmfCampaignInit.hh \
SmfCallback.hh \
-   SmfCbkUtil.hh
+   SmfCbkUtil.hh \
+   SmfExecControl.h
 
 osafsmfd_CXXFLAGS = $(AM_CXXFLAGS) @XML2_CFLAGS@
 
@@ -87,7 +88,8 @@ osafsmfd_SOURCES = \
SmfCampaignInit.cc \
SmfCampaignWrapup.cc \
SmfCallback.cc \
-   SmfCbkUtil.cc
+   SmfCbkUtil.cc \
+   SmfExecControl.cc
 
 osafsmfd_LDFLAGS = \
$(AM_LDFLAGS) \
diff --git a/osaf/services/saf/smfsv/smfd/SmfCampState.cc 
b/osaf/services/saf/smfsv/smfd/SmfCampState.cc
--- a/osaf/services/saf/smfsv/smfd/SmfCampState.cc
+++ b/osaf/services/saf/smfsv/smfd/SmfCampState.cc
@@ -32,8 +32,10 @@
 #include "SmfCampaignThread.hh"
 #include "SmfCampaign.hh"
 #include "SmfProcedureThread.hh"
+#include "smfsv_defs.h"
 #include 
 #include 
+#include "SmfUpgradeAction.hh"
 /* 
  *   DEFINITIONS
  * 
@@ -764,12 +766,7 @@ SmfCampStateExecuting::execute(SmfUpgrad
//must be restarted. The execution shall continue at step execution 
phase. The procedure initialization
//and step calculation was performed before the move of control.
 
-std::vector < SmfUpgradeProcedure * > procedures;
-if (i_camp->getProcExecutionMode() == SMF_MERGE_TO_SINGLE_STEP) {
-procedures.push_back(i_camp->getMergedProc());
-} else {
-procedures = i_camp->getProcedures();
-}
+std::vector procedures = i_camp->getProcedures();
 
 std::vector < SmfUpgradeProcedure * >::iterator iter;
bool execProcFound = false;
@@ -817,13 +814,7 @@ SmfCampStateExecuting::executeProc(SmfUp
//The procedure vector is sorted in execution level order (low -> high)
//Lowest number shall be executed first.
 
-std::vector < SmfUpgradeProcedure * > procedures;
-if (i_camp->getProcExecutionMode() == SMF_MERGE_TO_SINGLE_STEP) {
-procedures.push_back(i_camp->getMergedProc());
-} else {
-procedures = i_camp->getProcedures();
-}
-
+std::vector procedures = i_camp->getProcedures();
std::vector < SmfUpgradeProcedure * >::iterator iter;
int execLevel = -1;
 
@@ -912,12 +903,7 @@ SmfCampStateExecuting::suspend(SmfUpgrad
TRACE("SmfCampStateExecuting::suspend implementation");
 
/* Send suspend message to all procedures */
-std::vector < SmfUpgradeProcedure * > procedures;
-if (i_camp->getProcExecutionMode() == SMF_MERGE_TO_SINGLE_STEP) {
-procedures.push_back(i_camp->getMergedProc());
-} else {
-procedures = i_camp->getProcedures();
-}
+std::vector procedures = i_camp->getProcedures();
 
std::vector < SmfUpgradeProcedure * >::iterator iter;
 
@@ -966,12 +952,7 @@ SmfCampStateExecuting::procResult(SmfUpg