[devel] [PATCH 0/1] Review Request for imm: change log level to warning for "ER Problem in sending to IMMD over MDS" [#2465]

2017-05-19 Thread Zoran Milinkovic
Summary: imm: change log level to warning for "ER Problem in sending to IMMD 
over MDS" [#2465]
Review request for Ticket(s): 2465
Peer Reviewer(s): Hung, Neelakanta
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2465
Base revision: a2798cef6b42f6c000d5bc0d4b9593eca367ea87
Personal repository: git://git.code.sf.net/u/zmilinkovic/review


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):
-

revision 6d71bc3ef6fae9b601853f34c173eaecce7beee2
Author: Zoran Milinkovic 
Date:   Fri, 19 May 2017 14:35:12 +0200

imm: change log level to warning for "ER Problem in sending to IMMD over MDS" 
[#2465]

Log level for message "ER Problem in sending to IMMD over MDS" is changed from 
error to warning.



Complete diffstat:
--
 src/imm/immnd/immnd_evt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Message "Problem in sending to IMMD over MDS" should be logged as a warning.


Conditions of Submission:
-
Ack from Hung and Neelakanta


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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] imm: change log level to warning for "ER Problem in sending to IMMD over MDS" [#2465]

2017-05-19 Thread Zoran Milinkovic
Log level for message "ER Problem in sending to IMMD over MDS" is changed from 
error to warning.
---
 src/imm/immnd/immnd_evt.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/imm/immnd/immnd_evt.c b/src/imm/immnd/immnd_evt.c
index cacf4d5..21d8671 100644
--- a/src/imm/immnd/immnd_evt.c
+++ b/src/imm/immnd/immnd_evt.c
@@ -2939,7 +2939,7 @@ static uint32_t immnd_evt_proc_impl_set(IMMND_CB *cb, 
IMMND_EVT *evt,
NULL; /*precaution. */
 
if (rc != NCSCC_RC_SUCCESS) {
-   LOG_ER("Problem in sending to IMMD over MDS");
+   LOG_WA("Problem in sending to IMMD over MDS");
send_evt.info.imma.info.implSetRsp.error = SA_AIS_ERR_TRY_AGAIN;
cb->fevs_replies_pending--;
goto agent_rsp;
@@ -3055,7 +3055,7 @@ static uint32_t immnd_evt_proc_ccb_init(IMMND_CB *cb, 
IMMND_EVT *evt,
_evt);
 
if (rc != NCSCC_RC_SUCCESS) {
-   LOG_ER("Problem in sending ro IMMD over MDS");
+   LOG_WA("Problem in sending to IMMD over MDS");
send_evt.info.imma.info.ccbInitRsp.error = SA_AIS_ERR_TRY_AGAIN;
cb->fevs_replies_pending--;
goto agent_rsp;
@@ -3199,7 +3199,7 @@ static uint32_t immnd_evt_proc_rt_update(IMMND_CB *cb, 
IMMND_EVT *evt,
cb->immd_mdest_id, _evt);
 
if (rc != NCSCC_RC_SUCCESS) {
-   LOG_ER("Problem in sending to IMMD over MDS");
+   LOG_WA("Problem in sending to IMMD over MDS");
err = SA_AIS_ERR_TRY_AGAIN;
cb->fevs_replies_pending--;
goto agent_rsp;
-- 
1.9.1


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for smf: try to wait for opensafd status before executing reboot [#2464]

2017-05-19 Thread Rafael Odzakow
Summary: smf: try to wait for opensafd status before executing reboot [#2464]
Review request for Ticket(s): 2464
Peer Reviewer(s): lennart, reddy
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2464
Base revision: a2798cef6b42f6c000d5bc0d4b9593eca367ea87
Personal repository: git://git.code.sf.net/u/erafodz/review


Impacted area   Impact y/n

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


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 941789f355fccca2d547d09c5710c664b3a61dba
Author: Rafael Odzakow 
Date:   Fri, 19 May 2017 14:11:34 +0200

smf: try to wait for opensafd status before executing reboot [#2464]

There are cases when opensafd startup is still ongoing and SMF will send
out a reboot command for a node. Because opensafd has taken a lock the
reboot command will not be able to call opensafd stop. It is suggested
that SMF tries to wait for the release of the lock with "opensafd
status". The waiting time is short and SMF continues with reboot even if
the lock is not released.

ticket #2459 allows SMF to query the status of opensafd.

- Refactor smf remote command to have two versions, one that logs errors of
  the endpoint command and one without error logging.



Complete diffstat:
--
 src/smf/smfd/SmfUpgradeStep.cc |  23 ++
 src/smf/smfd/smfd_smfnd.c  | 102 +
 src/smf/smfd/smfd_smfnd.h  |   4 ++
 3 files changed, 90 insertions(+), 39 deletions(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check 

[devel] [PATCH 1/1] smf: try to wait for opensafd status before executing reboot [#2464]

2017-05-19 Thread Rafael Odzakow
There are cases when opensafd startup is still ongoing and SMF will send
out a reboot command for a node. Because opensafd has taken a lock the
reboot command will not be able to call opensafd stop. It is suggested
that SMF tries to wait for the release of the lock with "opensafd
status". The waiting time is short and SMF continues with reboot even if
the lock is not released.

ticket #2459 allows SMF to query the status of opensafd.

- Refactor smf remote command to have two versions, one that logs errors of
  the endpoint command and one without error logging.
---
 src/smf/smfd/SmfUpgradeStep.cc |  23 ++
 src/smf/smfd/smfd_smfnd.c  | 102 +
 src/smf/smfd/smfd_smfnd.h  |   4 ++
 3 files changed, 90 insertions(+), 39 deletions(-)

diff --git a/src/smf/smfd/SmfUpgradeStep.cc b/src/smf/smfd/SmfUpgradeStep.cc
index 2ffeab1..fc54019 100644
--- a/src/smf/smfd/SmfUpgradeStep.cc
+++ b/src/smf/smfd/SmfUpgradeStep.cc
@@ -54,6 +54,7 @@
 #include "smf/smfd/SmfRollback.h"
 #include "smf/smfd/SmfUtils.h"
 #include "osaf/immutil/immutil.h"
+#include "osaf/configmake.h"
 #include "smf/smfd/smfd_smfnd.h"
 #include "smfd.h"
 #include "base/osaf_time.h"
@@ -2299,6 +2300,28 @@ bool SmfUpgradeStep::nodeReboot() {
   goto done;
 }
 
+// Try to make sure opensafd is not in startup phase otherwise reboot will
+// not trigger opensafd stop.
+int counter = 0;
+while (counter < 5) {
+  TRACE("checking status of opensafd");
+  std::string command = LSBINITDIR;
+  command += "/opensafd status";
+  cmdrc = smfnd_remote_cmd(command.c_str(), ,
+   cliTimeout, localTimeout);
+  if ((cmdrc  & 0x) == SMFSV_CMD_RESULT_CODE &&
+  (cmdrc & 0x) == 150) {
+  // The lockfile is taken, try again
+  LOG_WA("opensafd status, retcode[%u] retry in 2 seconds",
+ cmdrc & 0x);
+  struct timespec time = {2, 0};
+  osaf_nanosleep();
+  counter += 1;
+  } else {
+break;
+  }
+}
+
 /* When executing a reboot command on a node the command will never return
so we want a short local timeout. Since the smfnd is handling the
cli timeout we want that to be much longer so that the reboot command
diff --git a/src/smf/smfd/smfd_smfnd.c b/src/smf/smfd/smfd_smfnd.c
index 23770ef..7384637 100644
--- a/src/smf/smfd/smfd_smfnd.c
+++ b/src/smf/smfd/smfd_smfnd.c
@@ -55,8 +55,10 @@ static SaVersionT clmVersion = {'B', 1, 1};
 
 static pthread_mutex_t smfnd_list_lock = PTHREAD_MUTEX_INITIALIZER;
 
-static uint32_t smfnd_remote_cmd(const char *i_cmd, MDS_DEST i_smfnd_dest,
-uint32_t i_timeout);
+static uint32_t smfnd_legacy_remote_cmd(const char *i_cmd,
+MDS_DEST i_smfnd_dest,
+uint32_t i_timeout);
+void log_rsp_errors(const char *i_cmd, uint32_t i_timeout, uint32_t i_result);
 
 /* 
  *   FUNCTION PROTOTYPES
@@ -240,6 +242,23 @@ uint32_t smfnd_down(SaClmNodeIdT i_node_id)
 uint32_t smfnd_exec_remote_cmd(const char *i_cmd, const SmfndNodeDest *i_smfnd,
   uint32_t i_timeout, uint32_t i_localTimeout)
 {
+uint32_t result = smfnd_remote_cmd(i_cmd, i_smfnd, i_timeout,
+   i_localTimeout);
+log_rsp_errors(i_cmd, i_timeout, result);
+return result;
+}
+
+/**
+ * smfnd_remote_cmd
+ * @param i_cmd Remote command to be executed
+ * @param i_smfnd Info about the smfnd node where to execute
+ * the command
+ * @param i_timeout Max time the command may take in 10 ms
+ */
+uint32_t smfnd_remote_cmd(const char *i_cmd, const SmfndNodeDest *i_smfnd,
+  uint32_t i_timeout, uint32_t i_localTimeout)
+
+{
SMFSV_EVT cmd_req_asynch;
SMFSV_EVT *cmd_rsp = 0;
uint32_t rc;
@@ -270,7 +289,7 @@ uint32_t smfnd_exec_remote_cmd(const char *i_cmd, const 
SmfndNodeDest *i_smfnd,
if (i_smfnd->rem_svc_pvt_ver == 1) {
/* This addressed smfnd can only handle the old cmd req message
 * format */
-   return smfnd_remote_cmd(i_cmd, i_smfnd->dest, i_timeout);
+   return smfnd_legacy_remote_cmd(i_cmd, i_smfnd->dest, i_timeout);
}
 
/* A new smfnd can handle the asynch message */
@@ -297,53 +316,58 @@ uint32_t smfnd_exec_remote_cmd(const char *i_cmd, const 
SmfndNodeDest *i_smfnd,
return SMFSV_CMD_EXEC_FAILED;
}
 
-   if (cmd_rsp->info.smfd.event.cmd_rsp.result != 0) { /* 0 = cmd OK */
-   switch (cmd_rsp->info.smfd.event.cmd_rsp.result & 0x) {
-   case SMFSV_CMD_EXEC_FAILED: {
-   LOG_ER("Command %s failed to start (%u)", i_cmd,
-  

[devel] [PATCH 1/1] base: Improve state report for opensafd [#2459]

2017-05-19 Thread Rafael Odzakow
Internally opensafd creates a lock file during start/stop to avoid
parallel execution. To allow others to query the state this ticket will
use the opensafd lockfile to report the status of start/stop when
requested with "opensafd status"
---
 src/nid/opensafd.in | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/nid/opensafd.in b/src/nid/opensafd.in
index e7683bd7e..c93cca7e1 100644
--- a/src/nid/opensafd.in
+++ b/src/nid/opensafd.in
@@ -326,8 +326,14 @@ forcereload() {
 }
 
 status() {
+
amfpid=`pidofproc -p $amfnd_pid $amfnd_bin`
-   if [ -n "$amfpid" ]; then
+
+   if [ -e "$lockfile_inprogress" ]; then
+echo "Lockfile taken, OpenSAF start/stop is in progress"
+# LSB defines 150-199 as application reserved exit codes
+RETVAL=150
+elif [ -n "$amfpid" ]; then
amf-state siass ha
RETVAL=$?
else
-- 
2.11.0


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for base: Improve state report for opensafd [#2459]

2017-05-19 Thread Rafael Odzakow
Summary: base: Improve state report for opensafd [#2459]
Review request for Ticket(s): 2459
Peer Reviewer(s): *** hans, anders
Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE ***
Affected branch(es): develop
Development branch: ticket-2459
Base revision: 3327fbe68a0dfb978ba6ee316927d96381f42037
Personal repository: git://git.code.sf.net/u/erafodz/review


Impacted area   Impact y/n

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


Comments (indicate scope for each "y" above):
-
*** EXPLAIN/COMMENT THE PATCH SERIES HERE ***

revision 790dabad23cf7eab652dbb7ae5ea6052a3cccdf3
Author: Rafael Odzakow 
Date:   Fri, 19 May 2017 12:39:40 +0200

base: Improve state report for opensafd [#2459]

Internally opensafd creates a lock file during start/stop to avoid
parallel execution. To allow others to query the state this ticket will
use the opensafd lockfile to report the status of start/stop when
requested with "opensafd status"



Complete diffstat:
--
 src/nid/opensafd.in | 8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)


Testing Commands:
-
*** LIST THE COMMAND LINE TOOLS/STEPS TO TEST YOUR CHANGES ***


Testing, Expected Results:
--
*** PASTE COMMAND OUTPUTS / TEST RESULTS ***


Conditions of Submission:
-
*** HOW MANY DAYS BEFORE PUSHING, CONSENSUS ETC ***


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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] imm: Clear dead IMMND info before switching to ACTIVE role [#2418]

2017-05-19 Thread Zoran Milinkovic
Hi Hung,

Reviewed the patch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 17 maj 2017 09:53
To: Zoran Milinkovic ; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 

Subject: [PATCH 1/1] imm: Clear dead IMMND info before switching to ACTIVE role 
[#2418]

During cold-sync, standby IMMD may receive info of dead IMMND.
Before switching to active, the IMMD should clear those dead IMMND info.
---
 src/imm/immd/immd_amf.c |  5 +
 src/imm/immd/immd_cb.h  |  2 +-
 src/imm/immd/immd_db.c  | 25 +++--  
src/imm/immd/immd_evt.c |  3 +++
 4 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/imm/immd/immd_amf.c b/src/imm/immd/immd_amf.c index 
82b933f..bd29faf 100644
--- a/src/imm/immd/immd_amf.c
+++ b/src/imm/immd/immd_amf.c
@@ -250,6 +250,11 @@ static void immd_saf_csi_set_cb(SaInvocationT invocation,
}
 
if (role_change) {
+   if (new_haState == SA_AMF_HA_ACTIVE) {
+   /* Cleanup dead IMMND nodes during coldsync */
+   immd_immnd_info_tree_cleanup(cb, true);
+   }
+
if (was_fully_initialized == true) {
if ((rc = immd_mds_change_role(cb)) !=
NCSCC_RC_SUCCESS) {
diff --git a/src/imm/immd/immd_cb.h b/src/imm/immd/immd_cb.h index 
2fc6264..3295e54 100644
--- a/src/imm/immd/immd_cb.h
+++ b/src/imm/immd/immd_cb.h
@@ -171,7 +171,7 @@ void immd_immnd_info_node_getnext(NCS_PATRICIA_TREE 
*immnd_tree, MDS_DEST *dest,  uint32_t immd_immnd_info_node_delete(IMMD_CB *cb,
  IMMD_IMMND_INFO_NODE *immnd_info_node);
 
-void immd_immnd_info_tree_cleanup(IMMD_CB *cb);
+void immd_immnd_info_tree_cleanup(IMMD_CB *cb, bool dead_only);
 
 void immd_immnd_info_tree_destroy(IMMD_CB *cb);
 
diff --git a/src/imm/immd/immd_db.c b/src/imm/immd/immd_db.c index 
d914c9c..81a8fdd 100644
--- a/src/imm/immd/immd_db.c
+++ b/src/imm/immd/immd_db.c
@@ -218,24 +218,29 @@ uint32_t immd_immnd_info_node_delete(IMMD_CB *cb,
   Arguments : IMMD_CB *cb - IMMD Control Block.
   Return Values : None
 /
-void immd_immnd_info_tree_cleanup(IMMD_CB *cb)
+void immd_immnd_info_tree_cleanup(IMMD_CB *cb, bool dead_only)
 {
IMMD_IMMND_INFO_NODE *immnd_info_node;
-   NODE_ID key;
-
-   memset(, 0, sizeof(NODE_ID));
 
/* Get the First Node */
immnd_info_node = (IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
-   >immnd_tree, (uint8_t *));
+   >immnd_tree, (uint8_t *)NULL);
while (immnd_info_node) {
-   key = m_NCS_NODE_ID_FROM_MDS_DEST(immnd_info_node->immnd_dest);
-
-   immd_immnd_info_node_delete(cb, immnd_info_node);
+   NODE_ID key = m_NCS_NODE_ID_FROM_MDS_DEST(
+   immnd_info_node->immnd_dest);
+   NODE_ID* key_pointer = 
+
+   if (!dead_only || !immnd_info_node->isUp) {
+   LOG_NO("Deleting IMMND dest:%" PRIu64,
+  immnd_info_node->immnd_dest);
+   immd_immnd_info_node_delete(cb, immnd_info_node);
+   /* Reset iteration */
+   key_pointer = NULL;
+   }
 
immnd_info_node =
(IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
-   >immnd_tree, (uint8_t *));
+   >immnd_tree, (uint8_t *)key_pointer);
}
 
return;
@@ -253,7 +258,7 @@ void immd_immnd_info_tree_destroy(IMMD_CB *cb)
return;
 
/* cleanup the client tree */
-   immd_immnd_info_tree_cleanup(cb);
+   immd_immnd_info_tree_cleanup(cb, false);
 
/* destroy the tree */
ncs_patricia_tree_destroy(>immnd_tree);
diff --git a/src/imm/immd/immd_evt.c b/src/imm/immd/immd_evt.c index 
adac747..24a4185 100644
--- a/src/imm/immd/immd_evt.c
+++ b/src/imm/immd/immd_evt.c
@@ -2966,6 +2966,9 @@ static uint32_t immd_evt_proc_rda_callback(IMMD_CB *cb, 
IMMD_EVT *evt)
 
LOG_NO("ACTIVE request");
 
+   /* Cleanup dead IMMND nodes during coldsync */
+   immd_immnd_info_tree_cleanup(cb, true);
+
if (was_fully_initialized == true) {
if ((rc = immd_mds_change_role(cb)) !=
NCSCC_RC_SUCCESS) {
--
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net

Re: [devel] [PATCH 1/1] imm: Discard Adm Impl continuation when peer IMMND is down [#2461]

2017-05-19 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Please, add in the comment and update the ticket that you also discard search 
impl continuation.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 17 maj 2017 09:40
To: Zoran Milinkovic ; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 

Subject: [PATCH 1/1] imm: Discard Adm Impl continuation when peer IMMND is down 
[#2461]

Discard Adm Impl continuation when peer IMMND is down.
---
 src/imm/immnd/ImmModel.cc | 24 
 1 file changed, 24 insertions(+)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index 
56d8c8d..25f8621 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -13804,6 +13804,7 @@ void ImmModel::discardNode(unsigned int deadNode, 
IdVector& cv, IdVector& gv,
   CcbVector::iterator i3;
   ConnVector implv;
   ConnVector::iterator i4;
+  ContinuationMap3::iterator ci3;
   TRACE_ENTER();
 
   if (sImmNodeState == IMM_NODE_W_AVAILABLE) { @@ -13923,6 +13924,29 @@ void 
ImmModel::discardNode(unsigned int deadNode, IdVector& cv, IdVector& gv,
   osafassert((*i3)->mOriginatingConn == 0);  // Dead node can not be us!!
 }
   }
+
+  /* Discard Adm Impl continuation */
+  for (ci3 = sAdmImplContinuationMap.begin();
+   ci3 != sAdmImplContinuationMap.end();) {
+if (m_NCS_NODE_ID_FROM_MDS_DEST(ci3->second.mReply_dest) == deadNode) {
+  TRACE_5("Discarding Adm Impl continuation %llu", ci3->first);
+  ci3 = sAdmImplContinuationMap.erase(ci3);
+} else {
+  ++ci3;
+}
+  }
+
+  /* Discard Search Impl continuation */  for (ci3 = 
+ sSearchImplContinuationMap.begin();
+   ci3 != sSearchImplContinuationMap.end();) {
+if (m_NCS_NODE_ID_FROM_MDS_DEST(ci3->second.mReply_dest) == deadNode) {
+  TRACE_5("Discarding Search Impl continuation %llu", ci3->first);
+  ci3 = sSearchImplContinuationMap.erase(ci3);
+} else {
+  ++ci3;
+}
+  }
+
   TRACE_LEAVE();
 }
 
--
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0/1] Review Request for ntf: ntftest to check longDnsAllowed to run or skip suite 35 [#2463] V2

2017-05-19 Thread Nguyen Luu
Summary: ntf: ntftest to check longDnsAllowed to run or skip suite 35 [#2463]
Review request for Ticket(s): 2463
Peer Reviewer(s): Minh H Chau, Vu M Nguyen
Pull request to: Minh H Chau
Affected branch(es): develop, release
Development branch: ticket-2463
Base revision: 1867ef71083edfad88dc3a9970549e6d35085bd2
Personal repository: git://git.code.sf.net/u/nguyenluu/review


Impacted area   Impact y/n

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


Comments (indicate scope for each "y" above):
-
revision 46f41bc31bc2c25346916a816144ec7370da7373
Author: Nguyen Luu 
Date:   Fri, 19 May 2017 15:47:20 +0700

ntf: ntftest to check longDnsAllowed to run or skip suite 35 [#2463]

Suite 35 of ntftest requires long-dns support be enabled in the system.

If ntftest is run without any argument or specific test suite, suite 35
should be skipped if long-dns support is not enabled in the system.



Complete diffstat:
--
 src/ntf/apitest/test_ntf_imcn.c | 70 ++---
 1 file changed, 51 insertions(+), 19 deletions(-)


Testing Commands:
-
Disble long-dns support in the system,
and run 'ntftest' without any argument.


Testing, Expected Results:
--
ntftest should pass and not run suite 35.


Conditions of Submission:
-
Ack from reviewers.


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  y  y
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 ~/.gitconfig file (i.e. user.name, user.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.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 1/1] ntf: ntftest to check longDnsAllowed to run or skip suite 35 [#2463]

2017-05-19 Thread Nguyen Luu
Suite 35 of ntftest requires long-dns support be enabled in the system.

If ntftest is run without any argument or specific test suite, suite 35
should be skipped if long-dns support is not enabled in the system.
---
 src/ntf/apitest/test_ntf_imcn.c | 70 ++---
 1 file changed, 51 insertions(+), 19 deletions(-)

diff --git a/src/ntf/apitest/test_ntf_imcn.c b/src/ntf/apitest/test_ntf_imcn.c
index 6973be3..c56e739 100644
--- a/src/ntf/apitest/test_ntf_imcn.c
+++ b/src/ntf/apitest/test_ntf_imcn.c
@@ -1625,6 +1625,38 @@ static void delete_rt_test_object(const char *dn)
safassert(saImmOiFinalize(immOiHnd), SA_AIS_OK);
 }
 
+static int isLongDnsAllowed()
+{
+  SaImmHandleT immHandle;
+  SaImmAccessorHandleT accessorHandle;
+  SaVersionT immVersion = {'A', 2, 15};
+  SaImmAttrNameT attrName = "longDnsAllowed";
+  SaImmAttrNameT attrNames[2] = {attrName, NULL};
+  SaImmAttrValuesT_2 **attributes = NULL;
+  SaConstStringT immObjectName = "opensafImm=opensafImm,safApp=safImmService";
+  int longDnsAllowed = 0;
+  int i;
+
+  safassert(saImmOmInitialize(, NULL, ), SA_AIS_OK);
+  safassert(saImmOmAccessorInitialize(immHandle, ), SA_AIS_OK);
+  safassert(saImmOmAccessorGet_o3(accessorHandle, immObjectName,
+attrNames, ), SA_AIS_OK);
+
+  for (i = 0; attributes[i]; ++i) {
+if (!strcmp(attrName, attributes[i]->attrName) &&
+attributes[i]->attrValuesNumber == 1 &&
+attributes[i]->attrValueType == SA_IMM_ATTR_SAUINT32T) {
+  longDnsAllowed = *(int *)attributes[i]->attrValues[0];
+  break;
+}
+  }
+
+  saImmOmAccessorFinalize(accessorHandle);
+  saImmOmFinalize(immHandle);
+
+  return longDnsAllowed;
+}
+
 /**
  * Create a runtime test object and verify correctness of generated
  * notification.
@@ -6289,23 +6321,23 @@ __attribute__((constructor)) static void 
ntf_imcn_constructor(void)
test_case_add(34, objectDeleteTest_3404,
  "DELETE, runtime (OsafNtfCmTestRT1) object");
 
-   test_suite_add(35, "CM notification test for extended name attribute");
-   test_case_add(
-   35, objectCreateTest_3501,
-   "CREATE, runtime (OsafNtfCmTestRT) object, extended name 
attribute");
-   test_case_add(35, objectModifyTest_3502,
- "runtime, attr ch, REPLACE (EXTENDED NAME, ANY)");
-   test_case_add(35, objectModifyTest_3503,
- "runtime, attr ch, ADD (EXTENDED NAME)");
-   test_case_add(35, objectDeleteTest_19,
- "DELETE, runtime (OsafNtfCmTestRT) object");
-   test_case_add(
-   35, objectCreateTest_3505,
-   "CREATE, config (OsafNtfCmTestCFG) object, extended name 
attribute");
-   test_case_add(35, objectModifyTest_3506,
- "config, attr ch, REPLACE (EXTENDED NAME, ANY)");
-   test_case_add(35, objectModifyTest_3507,
- "config, attr ch, ADD (EXTENDED NAME)");
-   test_case_add(35, objectDeleteTest_40,
- "DELETE, config (OsafNtfCmTestCFG) object");
+  if (isLongDnsAllowed()) {
+test_suite_add(35, "CM notification test for extended name attribute");
+test_case_add(35, objectCreateTest_3501,
+"CREATE, runtime (OsafNtfCmTestRT) object, extended name attribute");
+test_case_add(35, objectModifyTest_3502,
+"runtime, attr ch, REPLACE (EXTENDED NAME, ANY)");
+test_case_add(35, objectModifyTest_3503,
+"runtime, attr ch, ADD (EXTENDED NAME)");
+test_case_add(35, objectDeleteTest_19,
+"DELETE, runtime (OsafNtfCmTestRT) object");
+test_case_add(35, objectCreateTest_3505,
+"CREATE, config (OsafNtfCmTestCFG) object, extended name attribute");
+test_case_add(35, objectModifyTest_3506,
+"config, attr ch, REPLACE (EXTENDED NAME, ANY)");
+test_case_add(35, objectModifyTest_3507,
+"config, attr ch, ADD (EXTENDED NAME)");
+test_case_add(35, objectDeleteTest_40,
+"DELETE, config (OsafNtfCmTestCFG) object");
+  }
 }
-- 
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] amfnd: Buffered not-ack susi assignment response after both SC go down V2 [#2105]

2017-05-19 Thread praveen malviya
Ack.

Thanks
Praveen

On 19-May-17 12:48 PM, Minh Chau wrote:
> When amfnd-payload responds susi assignment response just before both SC
> go down, and that response message does not come to director. Therefore,
> the status of that assignment could be seen as "modifying" in IMM. When
> SC comes back, active amfd will be waiting for that response forever.
> 
> Patch checks if a susi assignment response is sent but not-ack just before
> both SC come down, amfnd-payload will buffer it in a way as a susi get
> assigned during SC absence
> ---
>   src/amf/amfnd/avnd_di.h |  2 +-
>   src/amf/amfnd/di.cc | 85 
> +++--
>   2 files changed, 70 insertions(+), 17 deletions(-)
> 
> diff --git a/src/amf/amfnd/avnd_di.h b/src/amf/amfnd/avnd_di.h
> index 07222eb67..d7ccd68fd 100644
> --- a/src/amf/amfnd/avnd_di.h
> +++ b/src/amf/amfnd/avnd_di.h
> @@ -79,7 +79,7 @@ uint32_t avnd_di_pg_act_send(struct avnd_cb_tag *, const 
> std::string &,
>AVSV_PG_TRACK_ACT, bool);
>   uint32_t avnd_di_msg_send(struct avnd_cb_tag *, AVND_MSG *);
>   void avnd_di_msg_ack_process(struct avnd_cb_tag *, uint32_t);
> -void avnd_diq_del(struct avnd_cb_tag *);
> +void avnd_diq_rec_check_buffered_msg(struct avnd_cb_tag *);
>   AVND_DND_MSG_LIST *avnd_diq_rec_add(struct avnd_cb_tag *cb, AVND_MSG *msg);
>   void avnd_diq_rec_del(struct avnd_cb_tag *cb, AVND_DND_MSG_LIST *rec);
>   void avnd_diq_rec_send_buffered_msg(struct avnd_cb_tag *cb);
> diff --git a/src/amf/amfnd/di.cc b/src/amf/amfnd/di.cc
> index e06b9260d..6f0a76cda 100644
> --- a/src/amf/amfnd/di.cc
> +++ b/src/amf/amfnd/di.cc
> @@ -698,8 +698,8 @@ uint32_t avnd_evt_mds_avd_dn_evh(AVND_CB *cb, AVND_EVT 
> *evt) {
> }
>   }
> } else {
> -TRACE("Delete all pending messages to be sent to AMFD");
> -avnd_diq_del(cb);
> +TRACE("Delete/Buffer pending messages to be sent to AMFD");
> +avnd_diq_rec_check_buffered_msg(cb);
> }
>   
> // check for pending messages FROM director
> @@ -1271,9 +1271,15 @@ void avnd_di_msg_ack_process(AVND_CB *cb, uint32_t 
> mid) {
>   }
>   
>   
> /
> -  Name  : avnd_diq_del
> +  Name  : avnd_diq_rec_check_buffered_msg
> +
> +  Description   : The routine buffers messages that are waiting for ack and 
> will
> +  resend to AMFD when AMFD is up.
> +  All messages are deleted, except following messages to be
> +  buffered:
> +  - AVSV_N2D_INFO_SU_SI_ASSIGN_MSG
> +  - AVSV_N2D_OPERATION_STATE_MSG
>   
> -  Description   : This routine clears the AvD msg list.
>   
> Arguments : cb - ptr to the AvND control block
>   
> @@ -1281,18 +1287,65 @@ void avnd_di_msg_ack_process(AVND_CB *cb, uint32_t 
> mid) {
>   
> Notes : None.
>   
> **/
> -void avnd_diq_del(AVND_CB *cb) {
> -  AVND_DND_MSG_LIST *rec = 0;
> -
> -  do {
> -/* pop the record */
> -m_AVND_DIQ_REC_POP(cb, rec);
> -if (!rec) break;
> -
> -/* delete the record */
> -avnd_diq_rec_del(cb, rec);
> -  } while (1);
> -
> +void avnd_diq_rec_check_buffered_msg(AVND_CB *cb) {
> +  if ((cb->dnd_list.head != nullptr)) {
> +AVND_DND_MSG_LIST *rec = 0;
> +bool found = true;
> +while (found) {
> +  found = false;
> +  for (rec = cb->dnd_list.head; rec != nullptr;) {
> +osafassert(rec->msg.type == AVND_MSG_AVD);
> +m_AVND_DIQ_REC_POP(cb, rec);
> +// Assignment response had been sent, but not ack because
> +// last controller go down, reset msg_id and will be resent later
> +if (rec->msg.info.avd->msg_type == AVSV_N2D_INFO_SU_SI_ASSIGN_MSG) {
> +  if (rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id != 0) {
> +rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id = 0;
> +found = true;
> +LOG_NO(
> +"Found not-ack su_si_assign msg for SU:'%s', "
> +"SI:'%s', ha_state:'%u', msg_act:'%u', single_csi:'%u', "
> +"error:'%u', msg_id:'%u'",
> +osaf_extended_name_borrow(>msg.info.avd->msg_info
> +   .n2d_su_si_assign.su_name),
> +osaf_extended_name_borrow(>msg.info.avd->msg_info
> +   .n2d_su_si_assign.si_name),
> +rec->msg.info.avd->msg_info.n2d_su_si_assign.ha_state,
> +rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_act,
> +rec->msg.info.avd->msg_info.n2d_su_si_assign
> +.single_csi,
> +rec->msg.info.avd->msg_info.n2d_su_si_assign.error,
> +rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id);
> +  }
> +  m_AVND_DIQ_REC_PUSH(cb, rec);
> +  

Re: [devel] [PATCH 1/1] imm: Remove CcbErrStrings that are set only on nodes with OI/PBE [#2446]

2017-05-19 Thread Zoran Milinkovic
Hi Hung,

In the patch, there was silently solved another problem.
Please, remove immnd_proc_global_abort_ccb() calls and open another ticket.

Ack from me when immnd_proc_global_abort_ccb() calls are removed.
No need for sending the patch to another review.

Thanks,
Zoran
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au]
Sent: den 10 maj 2017 08:41
To: Zoran Milinkovic ; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: Remove CcbErrStrings that are set only on nodes 
with OI/PBE [#2446]


Hi Zoran and Neel,



There's some copy-paste mistakes in the patch like



@@ -7469,9 +7452,8 @@ static void immnd_evt_proc_object_modify(IMMND_CB *cb, 
IMMND_EVT *evt,

   "OI Client went down so no modify upcall");

   err = SA_AIS_ERR_FAILED_OPERATION;

   delayedReply = false;

-  immModel_setCcbErrorString(

-  cb, evt->info.objModify.ccbId,

-  IMM_RESOURCE_ABORT "OI client went down");

+  immnd_proc_global_abort_ccb(

+  cb, evt->info.objCreate.ccbId);

   } else {

   memset(_evt, '\0', sizeof(IMMSV_EVT));

   send_evt.type = IMMSV_EVT_TYPE_IMMA;



(should be evt->info.objModify.ccbId)



I will fix them while pushing if there's no comments on the patch.



BR,

Hung Nguyen - DEK Technologies




From: Hung Nguyen 
hung.d.ngu...@dektech.com.au

Sent: Tuesday, May 09, 2017 3:15PM

To: Zoran Milinkovic, Neelakanta Reddy

zoran.milinko...@ericsson.com, 
reddy.neelaka...@oracle.com

Cc: Opensaf-devel, Hung Nguyen


opensaf-devel@lists.sourceforge.net,
 hung.d.ngu...@dektech.com.au

Subject: [PATCH 1/1] imm: Remove CcbErrStrings that are set only on nodes with 
OI/PBE [#2446]





Remove CcbErrStrings that are set only on nodes with OI/PBE.

Abort the CCB when those errors occur to avoid taking long time to abort the 
CCB (due to timeout).

---

 src/imm/immnd/immnd_evt.c | 68 ---

 1 file changed, 17 insertions(+), 51 deletions(-)



diff --git a/src/imm/immnd/immnd_evt.c b/src/imm/immnd/immnd_evt.c

index 872bc62..eba29da 100644

--- a/src/imm/immnd/immnd_evt.c

+++ b/src/imm/immnd/immnd_evt.c

@@ -7116,9 +7116,6 @@ static void immnd_evt_proc_object_create(IMMND_CB *cb, 
IMMND_EVT *evt,

  should prevent any apply to succeed.

   */

   err = SA_AIS_ERR_FAILED_OPERATION;

-  immModel_setCcbErrorString(

-  cb, evt->info.objCreate.ccbId,

-  IMM_RESOURCE_ABORT "PBE is down");

   immnd_proc_global_abort_ccb(cb,

  evt->info.objCreate.ccbId);

   } else {

@@ -7143,10 +7140,6 @@ static void immnd_evt_proc_object_create(IMMND_CB *cb, 
IMMND_EVT *evt,

   LOG_ER("Upcall over MDS for ccbObjectCreate "

  "to PBE failed! - aborting");

   err = SA_AIS_ERR_FAILED_OPERATION;

-  immModel_setCcbErrorString(

-  cb, evt->info.objCreate.ccbId,

-  IMM_RESOURCE_ABORT

-  "Upcall over MDS to PBE failed");

   immnd_proc_global_abort_ccb(

   cb, evt->info.objCreate.ccbId);

   }

@@ -7169,9 +7162,8 @@ static void immnd_evt_proc_object_create(IMMND_CB *cb, 
IMMND_EVT *evt,

   LOG_WA("Client died");

   err = SA_AIS_ERR_FAILED_OPERATION;

   delayedReply = false;

-  immModel_setCcbErrorString(

-  cb, evt->info.objCreate.ccbId,

-  IMM_RESOURCE_ABORT "Client died");

+  immnd_proc_global_abort_ccb(

+  cb, evt->info.objCreate.ccbId);

   } else {

   memset(_evt, '\0', sizeof(IMMSV_EVT));

   send_evt.type = IMMSV_EVT_TYPE_IMMA;

@@ -7202,10 +7194,8 @@ static void immnd_evt_proc_object_create(IMMND_CB *cb, 
IMMND_EVT *evt,

  LOG_ER(

   

[devel] [PATCH 1/1] amfnd: Buffered not-ack susi assignment response after both SC go down V2 [#2105]

2017-05-19 Thread Minh Chau
When amfnd-payload responds susi assignment response just before both SC
go down, and that response message does not come to director. Therefore,
the status of that assignment could be seen as "modifying" in IMM. When
SC comes back, active amfd will be waiting for that response forever.

Patch checks if a susi assignment response is sent but not-ack just before
both SC come down, amfnd-payload will buffer it in a way as a susi get
assigned during SC absence
---
 src/amf/amfnd/avnd_di.h |  2 +-
 src/amf/amfnd/di.cc | 85 +++--
 2 files changed, 70 insertions(+), 17 deletions(-)

diff --git a/src/amf/amfnd/avnd_di.h b/src/amf/amfnd/avnd_di.h
index 07222eb67..d7ccd68fd 100644
--- a/src/amf/amfnd/avnd_di.h
+++ b/src/amf/amfnd/avnd_di.h
@@ -79,7 +79,7 @@ uint32_t avnd_di_pg_act_send(struct avnd_cb_tag *, const 
std::string &,
  AVSV_PG_TRACK_ACT, bool);
 uint32_t avnd_di_msg_send(struct avnd_cb_tag *, AVND_MSG *);
 void avnd_di_msg_ack_process(struct avnd_cb_tag *, uint32_t);
-void avnd_diq_del(struct avnd_cb_tag *);
+void avnd_diq_rec_check_buffered_msg(struct avnd_cb_tag *);
 AVND_DND_MSG_LIST *avnd_diq_rec_add(struct avnd_cb_tag *cb, AVND_MSG *msg);
 void avnd_diq_rec_del(struct avnd_cb_tag *cb, AVND_DND_MSG_LIST *rec);
 void avnd_diq_rec_send_buffered_msg(struct avnd_cb_tag *cb);
diff --git a/src/amf/amfnd/di.cc b/src/amf/amfnd/di.cc
index e06b9260d..6f0a76cda 100644
--- a/src/amf/amfnd/di.cc
+++ b/src/amf/amfnd/di.cc
@@ -698,8 +698,8 @@ uint32_t avnd_evt_mds_avd_dn_evh(AVND_CB *cb, AVND_EVT 
*evt) {
   }
 }
   } else {
-TRACE("Delete all pending messages to be sent to AMFD");
-avnd_diq_del(cb);
+TRACE("Delete/Buffer pending messages to be sent to AMFD");
+avnd_diq_rec_check_buffered_msg(cb);
   }
 
   // check for pending messages FROM director
@@ -1271,9 +1271,15 @@ void avnd_di_msg_ack_process(AVND_CB *cb, uint32_t mid) {
 }
 
 /
-  Name  : avnd_diq_del
+  Name  : avnd_diq_rec_check_buffered_msg
+
+  Description   : The routine buffers messages that are waiting for ack and 
will
+  resend to AMFD when AMFD is up.
+  All messages are deleted, except following messages to be
+  buffered:
+  - AVSV_N2D_INFO_SU_SI_ASSIGN_MSG
+  - AVSV_N2D_OPERATION_STATE_MSG
 
-  Description   : This routine clears the AvD msg list.
 
   Arguments : cb - ptr to the AvND control block
 
@@ -1281,18 +1287,65 @@ void avnd_di_msg_ack_process(AVND_CB *cb, uint32_t mid) 
{
 
   Notes : None.
 **/
-void avnd_diq_del(AVND_CB *cb) {
-  AVND_DND_MSG_LIST *rec = 0;
-
-  do {
-/* pop the record */
-m_AVND_DIQ_REC_POP(cb, rec);
-if (!rec) break;
-
-/* delete the record */
-avnd_diq_rec_del(cb, rec);
-  } while (1);
-
+void avnd_diq_rec_check_buffered_msg(AVND_CB *cb) {
+  if ((cb->dnd_list.head != nullptr)) {
+AVND_DND_MSG_LIST *rec = 0;
+bool found = true;
+while (found) {
+  found = false;
+  for (rec = cb->dnd_list.head; rec != nullptr;) {
+osafassert(rec->msg.type == AVND_MSG_AVD);
+m_AVND_DIQ_REC_POP(cb, rec);
+// Assignment response had been sent, but not ack because
+// last controller go down, reset msg_id and will be resent later
+if (rec->msg.info.avd->msg_type == AVSV_N2D_INFO_SU_SI_ASSIGN_MSG) {
+  if (rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id != 0) {
+rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id = 0;
+found = true;
+LOG_NO(
+"Found not-ack su_si_assign msg for SU:'%s', "
+"SI:'%s', ha_state:'%u', msg_act:'%u', single_csi:'%u', "
+"error:'%u', msg_id:'%u'",
+osaf_extended_name_borrow(>msg.info.avd->msg_info
+   .n2d_su_si_assign.su_name),
+osaf_extended_name_borrow(>msg.info.avd->msg_info
+   .n2d_su_si_assign.si_name),
+rec->msg.info.avd->msg_info.n2d_su_si_assign.ha_state,
+rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_act,
+rec->msg.info.avd->msg_info.n2d_su_si_assign
+.single_csi,
+rec->msg.info.avd->msg_info.n2d_su_si_assign.error,
+rec->msg.info.avd->msg_info.n2d_su_si_assign.msg_id);
+  }
+  m_AVND_DIQ_REC_PUSH(cb, rec);
+  break;
+} else if (rec->msg.info.avd->msg_type ==
+  AVSV_N2D_OPERATION_STATE_MSG) {
+  if (rec->msg.info.avd->msg_info.n2d_opr_state.msg_id != 0) {
+rec->msg.info.avd->msg_info.n2d_opr_state.msg_id = 0;
+found = true;
+LOG_NO(
+"Found