[devel] [PATCH 0 of 1] Review Request for imm:send 2PBE preload information for controller IMMND [#1925]

2016-07-26 Thread reddy . neelakanta
Summary: imm:send 2PBE preload information for controller IMMND [#1925] 
Review request for Trac Ticket(s): 1925
Peer Reviewer(s): Zoran, Hung
Affected branch(es): 5.0.x, default
Development branch: default


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

changeset 33aac51dbfa48cddcd4daa808a69d4015a3b7b95
Author: Neelakanta Reddy
Date:   Tue, 26 Jul 2016 16:46:00 +0530

imm:send 2PBE preload information for controller IMMND [#1925]

with the #79 patch, the mds_register of standby is delayed until amfd 
gives
role. Because of this the standby IMMND is not able to send pr-load
information.

The patch sends preload information by checking node_type. If the 
node_type
is controller the preload information is sent.


Complete diffstat:
--
 osaf/services/saf/immsv/README.2PBE|   7 +++
 osaf/services/saf/immsv/immd/immd_evt.c|  38 
+++---
 osaf/services/saf/immsv/immnd/immnd_cb.h   |   1 +
 osaf/services/saf/immsv/immnd/immnd_evt.c  |   2 +-
 osaf/services/saf/immsv/immnd/immnd_main.c |  22 ++
 5 files changed, 66 insertions(+), 4 deletions(-)


Testing Commands:
-
As explained in the description of the ticket

Testing, Expected Results:
--
start two contollers simoultaneously, 2PBE information must be sent by both 
controllers.

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 ~/.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.


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev

[devel] [PATCH 1 of 1] imm:send 2PBE preload information for controller IMMND [#1925]

2016-07-26 Thread reddy . neelakanta
 osaf/services/saf/immsv/README.2PBE|   7 +
 osaf/services/saf/immsv/immd/immd_evt.c|  38 +++--
 osaf/services/saf/immsv/immnd/immnd_cb.h   |   1 +
 osaf/services/saf/immsv/immnd/immnd_evt.c  |   2 +-
 osaf/services/saf/immsv/immnd/immnd_main.c |  22 +
 5 files changed, 66 insertions(+), 4 deletions(-)


with the #79 patch, the mds_register of standby is delayed until amfd gives 
role.
Because of this the standby IMMND is not able to send pr-load information.

The patch sends preload information by checking node_type. If the node_type is
controller the preload information is sent.

diff --git a/osaf/services/saf/immsv/README.2PBE 
b/osaf/services/saf/immsv/README.2PBE
--- a/osaf/services/saf/immsv/README.2PBE
+++ b/osaf/services/saf/immsv/README.2PBE
@@ -175,3 +175,10 @@ toggle this flag on.
 For "normal", but unplanned, processor restarts, we recommend that this flag 
not be
 toggled on. This means that for such processor restarts, persistent writes 
will not be
 allowed untill both SCs are available again.
+
+2PBE with spares(#79 & #1925)
+
+From OpenSAG 5.0 the mds_register for IMMD is delayed until amfd comes up and 
gives role.
+Because of this the standby role is delayed. There is a chance that chosen 
standby immnd 
+can be from different node than the actual node which got standby role. It is 
not
+recommended to configure 2PBE with spares.
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
@@ -732,7 +732,11 @@ static void immd_accept_node(IMMD_CB *cb
cb->immnd_coord = node_info->immnd_key;
cb->payload_coord_dest = node_info->immnd_dest;
node_info->isCoord = true;
-   }
+   } else if(cb->immnd_coord == 0 && cb->mIs2Pbe){
+   LOG_NO("IMMND found at %x Cluster is loading. 2PBE configured 
=> Wait.", node_info->immnd_key);
+   accept_evt.info.immnd.info.ctrl.canBeCoord = 2; /* 2PBE => 
order preload. */
+}
+
 
if (node_info->isCoord) {
accept_evt.info.immnd.info.ctrl.isCoord = true;
@@ -1979,8 +1983,18 @@ static uint32_t immd_evt_proc_2pbe_prelo
evt->info.pbe2.epoch, evt->info.pbe2.maxCcbId,
evt->info.pbe2.maxCommitTime);
cb->remPbe = evt->info.pbe2;
+   } else if (!cb->is_rem_immnd_up && !cb->immd_remote_up) {
+   LOG_NO("2PBE preload info from first remote SC can be standby 
Epoch: %u MaxCcb:%u MaxTime%u",
+   evt->info.pbe2.epoch, evt->info.pbe2.maxCcbId,
+   evt->info.pbe2.maxCommitTime);
+   cb->is_rem_immnd_up = true;
+   cb->rem_immnd_dest = sinfo->dest;
+   cb->remPbe = evt->info.pbe2;
+   } else if (cb->is_rem_immnd_up){
+   LOG_NO("2PBE preload info from remote SC may be from spare will 
be discarded");
}
 
+
if(cb->m2PbeCanLoad) {
LOG_NO("m2PbeCanLoad already set (timeout ?)");
} else {
@@ -2632,6 +2646,7 @@ static uint32_t immd_evt_proc_mds_evt(IM
TRACE_5("Process MDS EVT NCSMDS_RED_UP, my PID:%u", getpid());
if (cb->node_id != mds_info->node_id) {
MDS_DEST tmpDest = 0LL;
+   uint32_t immnd_remote_id = 0;
TRACE_5("Remote IMMD is UP.");
 
cb->immd_remote_id = 
immd_get_slot_and_subslot_id_from_node_id(mds_info->node_id);
@@ -2652,16 +2667,33 @@ static uint32_t immd_evt_proc_mds_evt(IM
 
node_info->isOnController = 
true;
TRACE_5("Located STDBY IMMND =  
%x node_id:%x",
-   
immd_get_slot_and_subslot_id_from_node_id(mds_info->node_id),
+   
immd_get_slot_and_subslot_id_from_node_id(mds_info->node_id),
mds_info->node_id);
-   immd_accept_node(cb, node_info, 
true, false); /* < Can not be sc-absence veteran if on sc. */
+   if(!cb->is_rem_immnd_up){
+   immd_accept_node(cb, 
node_info, true, false); /* < Can not be sc-absence veteran if on sc. */
+   } if (cb->is_rem_immnd_up && 
cb->mIs2Pbe){
+   immnd_remote_id = 
+
immd_get_slot_and_subslot_id_from_mds_dest(node_info->immnd_dest);
+   }
+   

[devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638] V1

2016-07-26 Thread mahesh . valla
Summary:lgsv: Log Service CLM integration [#1638] V1 
Review request for Trac Ticket(s): #1638
Peer Reviewer(s): Vu, Lennart
Pull request to: <>
Affected branch(es): Default
Development branch: Default


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 0637f0bfc39b5173776b3cdca088cffd28425432
Author: A V Mahesh 
Date:   Tue, 26 Jul 2016 14:07:35 +0530

lga: agent Cluster Membership (CLM) integration [#1638] V1 Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of 
client's
node. old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log 
Service
API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes 
on
cluster nodes that are not in the cluster membership.

If the node rejoins the cluster membership, processes executing on the 
node
will be able to reinitialize new library handles and use the entire set 
of
Log Service APIs that operate on these new handles; however, invocation 
of
APIs that operate on handles acquired by any process before the node 
left
the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
with
the special treatment described above for asynchronous calls) with the
exception of saLogFinalize(), which is used to free the library handles 
and
all resources associated with these handles. Hence, it is recommended 
for
the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node, Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
Non-
Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE 
(31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + 
(Head
Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)

changeset fed6d0af1a288640e078bdac58b00c0c79691e97
Author: A V Mahesh 
Date:   Tue, 26 Jul 2016 14:08:09 +0530

lgs: director Cluster Membership (CLM) integration [#1638] V1

changeset 6842daa277070d2ac2c80eb6c69271521a51d563
Author: A V Mahesh 
Date:   Tue, 26 Jul 2016 14:09:35 +0530

logtest: change related to Cluster Membership (CLM) integration [#1638] 
V1
Test :

 #amf-adm lock safNode=PL-4,safCluster=myClmCluster

  failed with code SA_AIS_ERR_UNAVAILABLE (31).

#amf-adm unlock safNode=PL-4,safCluster=myClmCluster

  failed with code SA_AIS_ERR_UNAVAILABLE (31).

 #amf-adm lock safNode=PL-4,safCluster=myClmCluster + (SC-1 & Sc-2
/etc/init.d/opensafd stop)

  failed with code SA_AIS_ERR_UNAVAILABLE (31)

# amf-adm lock safNode=PL-4,safCluster=myClmCluster + ((SC-1 & Sc-2
/etc/init.d/opensafd stop)) + ((SC-1 & Sc-2 /etc/init.d/opensafd
start) + amf-adm unlock safNode=PL-4,safCluster=myClmCluster

  failed with code SA_AIS_ERR_UNAVAILABLE (31)

 Expected but currently The Imm APIs are NOT working error -
saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2)


Complete diffstat:
--
 osaf/libs/agents/saf/lga/lga.h |2 +
 osaf/libs/agents/saf/lga/lga_api.c |   37 
+++
 osaf/libs/agents/saf/lga/lga_mds.c |   75 

 osaf/libs/agents/saf/lga/lga_util.c|2 +
 osaf/libs/common/logsv/include/lgsv_defs.h |6 -
 osaf/libs/common/logsv/include/lgsv_msg.h  |   17 ---
 osaf/services/saf/logsv/lgs/Makefile.am|4 ++-
 osaf/services/saf/logsv/lgs/lgs.h  |5 
 osaf/services/saf/logsv/lgs/lgs_cb.h   |   15 ++
 osaf/services/saf/logsv/lgs/lgs_clm.cc |  143 
++
 osaf/services/saf/logsv/lgs/lgs_evt.cc |  142 

[devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638] V1

2016-07-26 Thread mahesh . valla
 osaf/services/saf/logsv/lgs/Makefile.am |4 +-
 osaf/services/saf/logsv/lgs/lgs.h   |5 +
 osaf/services/saf/logsv/lgs/lgs_cb.h|   15 +++
 osaf/services/saf/logsv/lgs/lgs_clm.cc  |  143 
 osaf/services/saf/logsv/lgs/lgs_evt.cc  |  142 +++
 osaf/services/saf/logsv/lgs/lgs_evt.h   |1 +
 osaf/services/saf/logsv/lgs/lgs_main.cc |   29 ++
 osaf/services/saf/logsv/lgs/lgs_mds.cc  |   41 -
 osaf/services/saf/logsv/lgs/lgs_util.cc |   83 ++
 9 files changed, 460 insertions(+), 3 deletions(-)


diff --git a/osaf/services/saf/logsv/lgs/Makefile.am 
b/osaf/services/saf/logsv/lgs/Makefile.am
--- a/osaf/services/saf/logsv/lgs/Makefile.am
+++ b/osaf/services/saf/logsv/lgs/Makefile.am
@@ -67,7 +67,8 @@ osaflogd_SOURCES = \
lgs_mbcsv_v3.cc \
lgs_mbcsv_v5.cc \
lgs_recov.cc \
-   lgs_imm_gcfg.cc
+   lgs_imm_gcfg.cc \
+   lgs_clm.cc
 
 osaflogd_LDADD = \
$(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
@@ -75,4 +76,5 @@ osaflogd_LDADD = \
$(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
+   $(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
$(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
diff --git a/osaf/services/saf/logsv/lgs/lgs.h 
b/osaf/services/saf/logsv/lgs/lgs.h
--- a/osaf/services/saf/logsv/lgs/lgs.h
+++ b/osaf/services/saf/logsv/lgs/lgs.h
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "saAmf.h"
 
 /* LGS files */
@@ -78,6 +79,7 @@
 #define LGS_LOG_SHARED_FILESYSTEM 1/* Use shared filesystem. 
Default */
 #define LGS_LOG_SPLIT_FILESYSTEM  2 /* Store logs on local file system on
each node */
+#define m_LGS_GET_NODE_ID_FROM_ADEST(adest) (NODE_ID) ((uint64_t)adest >> 32)
 
 /* 
  *   DATA DECLARATIONS
@@ -131,4 +133,7 @@ int lgs_get_streamobj_attr(SaImmAttrValu
   SaImmHandleT *immOmHandle);
 int lgs_free_streamobj_attr(SaImmHandleT immHandle);
 
+extern uint32_t send_clm_node_status_change(SaClmClusterChangesT 
cluster_change, NODE_ID node_id);
+extern void lgs_init_with_clm(void);
+
 #endif   /* ifndef __LGS_H */
diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h 
b/osaf/services/saf/logsv/lgs/lgs_cb.h
--- a/osaf/services/saf/logsv/lgs/lgs_cb.h
+++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -55,6 +56,11 @@ typedef struct lgs_stream_list {
 } lgs_stream_list_t;
 
 typedef struct {
+   NCS_PATRICIA_NODE patnode;
+   NODE_ID node_id;
+} lgs_clm_node_t;
+
+typedef struct {
NCS_PATRICIA_NODE pat_node;
uint32_t client_id;
uint32_t client_id_net;
@@ -73,6 +79,7 @@ typedef struct lgs_cb {
MDS_DEST vaddr; /* My identification in MDS  */
SaVersionT log_version; /* The version currently supported   */
NCS_PATRICIA_TREE client_tree;  /* LGA/Library/Client instantiation 
pat. tree */
+   NCS_PATRICIA_TREE clm_node_tree;  /* LGA/Library/Client instantiation 
pat. tree */
SaNameT comp_name;  /* Components's name LGS */
SaAmfHandleT amf_hdl;   /* AMF handle, obtained thru AMF init*/
SaSelectionObjectT amfSelectionObject;  /* Selection Object to wait for 
AMF events */
@@ -80,6 +87,9 @@ typedef struct lgs_cb {
bool is_quiesced_set;
SaImmOiHandleT immOiHandle; /* IMM OI handle
   */
SaSelectionObjectT immSelectionObject;  /* Selection Object to wait for 
IMM events */
+   SaSelectionObjectT clmSelectionObject;  /* Selection Object to wait for 
clms events */
+   SaClmHandleT clm_hdl;   /* CLM handle, obtained through CLM init
*/
+   bool clm_initialized; //For CLM init status;
SaAmfHAStateT ha_state; /* present AMF HA state of the component */
uint32_t last_client_id;/* Value of last client_id assigned 
 */
uint32_t async_upd_cnt; /* Async Update Count for Warmsync */
@@ -94,6 +104,7 @@ typedef struct lgs_cb {
down events Processing */
LGA_DOWN_LIST *lga_down_list_tail;
 
+   NCS_SEL_OBJ usr2_sel_obj; /* Selection object for CLM initialization.*/
bool nid_started;   /**< true if started by NID */
SaUint32T scAbsenceAllowed; /* OpenSAF global configuration for 
recovery handling */
lgs_state_t lgs_recovery_state; /* Indicate current recovery state for 
the server */
@@ -106,5 +117,9 @@ typedef struct lgs_cb {
 extern uint32_t lgs_cb_init(lgs_cb_t *);
 extern void lgs_process_mbx(SYSF_MBX *mbx);
 extern 

[devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638] V1

2016-07-26 Thread mahesh . valla
 osaf/libs/agents/saf/lga/lga.h |   2 +
 osaf/libs/agents/saf/lga/lga_api.c |  37 ++
 osaf/libs/agents/saf/lga/lga_mds.c |  75 ++
 osaf/libs/agents/saf/lga/lga_util.c|   2 +
 osaf/libs/common/logsv/include/lgsv_defs.h |   6 ++-
 osaf/libs/common/logsv/include/lgsv_msg.h  |  17 +-
 6 files changed, 134 insertions(+), 5 deletions(-)


Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of client's node.
 old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log Service API 
on a
Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes on 
cluster nodes that are not
in the cluster membership.

If the node rejoins the cluster membership, processes executing on the node 
will be
able to reinitialize new library handles and use the entire set of Log Service 
APIs that
operate on these new handles; however, invocation of APIs that operate on 
handles
acquired by any process before the node left the membership will continue to 
fail with
SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above for
asynchronous calls) with the exception of saLogFinalize(), which is used to 
free the
library handles and all resources associated with these handles. Hence, it is 
recommended
for the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node,  Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case2: On Member Node after recovered from Non-Member Node, Log Service API 
will fail with code SA_AIS_ERR_UNAVAILABLE (31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API will 
fail with code SA_AIS_ERR_UNAVAILABLE (31)

diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h
--- a/osaf/libs/agents/saf/lga/lga.h
+++ b/osaf/libs/agents/saf/lga/lga.h
@@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec {
 * Set when client is initialized an all
 * streams are recovered
 */
+   bool is_stale_client;  /* Status of client based on the CLM status of 
node.*/
 } lga_client_hdl_rec_t;
 
 /* States of the server */
@@ -118,6 +119,7 @@ typedef struct {
/* LGS LGA sync params */
int lgs_sync_awaited;
NCS_SEL_OBJ lgs_sync_sel;
+   SaClmClusterChangesT clm_node_state; /*Reflects CLM status of this 
node(for future use).*/
 } lga_cb_t;
 
 /* lga_saf_api.c */
diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -325,6 +325,14 @@ SaAisErrorT saLogSelectionObjectGet(SaLo
goto done;
}
 
+   /*Check CLM membership of node.*/
+if (hdl_rec->is_stale_client == true) {
+   TRACE("Node not CLM member or stale client");
+   ncshm_give_hdl(logHandle);
+   rc = SA_AIS_ERR_UNAVAILABLE;
+goto done;
+}
+
/* Obtain the selection object from the IPC queue */
sel_obj = m_NCS_IPC_GET_SEL_OBJ(_rec->mbx);
 
@@ -381,6 +389,14 @@ SaAisErrorT saLogDispatch(SaLogHandleT l
goto done;
}
 
+   /*Check CLM membership of node.*/
+ if (hdl_rec->is_stale_client == true) {
+ TRACE("Node not CLM member or stale client");
+ ncshm_give_hdl(logHandle);
+ rc = SA_AIS_ERR_UNAVAILABLE;
+ goto done;
+}
+
if ((rc = lga_hdl_cbk_dispatch(_cb, hdl_rec, dispatchFlags)) != 
SA_AIS_OK)
TRACE("LGA_DISPATCH_FAILURE");
 
@@ -776,6 +792,13 @@ SaAisErrorT saLogStreamOpen_2(SaLogHandl
ais_rc = SA_AIS_ERR_BAD_HANDLE;
goto done;
}
+   
+   /*Check CLM membership of node.*/
+if (hdl_rec->is_stale_client == true) {
+   TRACE("%s Node not CLM member or stale client", __FUNCTION__);
+   ais_rc = SA_AIS_ERR_UNAVAILABLE;
+   goto done_give_hdl;
+}
 
/***
 * Handle states
@@ -1202,6 +1225,13 @@ SaAisErrorT saLogWriteLogAsync(SaLogStre
goto done_give_hdl_stream;
}
 
+   /*Check CLM membership of node.*/
+   if (hdl_rec->is_stale_client == true) {
+   TRACE("%s Node not CLM member or stale client", __FUNCTION__);
+   ais_rc = SA_AIS_ERR_UNAVAILABLE;
+   goto done_give_hdl_all;
+   }
+
 

[devel] [PATCH 3 of 3] logtest: change related to Cluster Membership (CLM) integration [#1638] V1

2016-07-26 Thread mahesh . valla
 tests/logsv/saflogtest.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)


Test :

  #amf-adm lock safNode=PL-4,safCluster=myClmCluster

 failed with code SA_AIS_ERR_UNAVAILABLE (31).

#amf-adm unlock safNode=PL-4,safCluster=myClmCluster

 failed with code SA_AIS_ERR_UNAVAILABLE (31).

 #amf-adm lock safNode=PL-4,safCluster=myClmCluster  + (SC-1 & Sc-2 
/etc/init.d/opensafd stop)

 failed with code SA_AIS_ERR_UNAVAILABLE (31)

# amf-adm lock safNode=PL-4,safCluster=myClmCluster  + ((SC-1 & Sc-2 
/etc/init.d/opensafd stop)) +
  ((SC-1 & Sc-2 /etc/init.d/opensafd start) + amf-adm unlock 
safNode=PL-4,safCluster=myClmCluster

   failed with code SA_AIS_ERR_UNAVAILABLE (31)

  Expected  but currently The Imm APIs are NOT working
error - saImmOmInitialize FAILED: SA_AIS_ERR_LIBRARY (2)

diff --git a/tests/logsv/saflogtest.c b/tests/logsv/saflogtest.c
--- a/tests/logsv/saflogtest.c
+++ b/tests/logsv/saflogtest.c
@@ -86,7 +86,7 @@ static inline void time_meas_log(time_me
 static void logWriteLogCallbackT(SaInvocationT invocation, SaAisErrorT error);
 
 static SaLogCallbacksT logCallbacks = { 0, 0, logWriteLogCallbackT };
-static SaVersionT logVersion = { 'A', 2, 1 };
+static SaVersionT logVersion = { 'A', 2, 2 };
 
 static char *progname = "saflogtest";
 static SaInvocationT cb_invocation;

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports.http://sdm.link/zohodev2dev
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638]

2016-07-26 Thread A V Mahesh
Hi,

I missed to add new file ? osaf/services/saf/logsv/lgs/lgs_clm.cc  , 
please hold i will republish V1


-AVM


On 7/26/2016 1:48 PM, mahesh.va...@oracle.com wrote:
> Summary:lgsv: Log Service CLM integration [#1638]
> Review request for Trac Ticket(s): #1638
> Peer Reviewer(s): Vu, Lennar
> Pull request to:
> Affected branch(es): default
> Development branch: default
>
> 
> 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 3cea257f1e7fc8570828ece564f9bfa563c0693b
> Author:   A V Mahesh 
> Date: Tue, 26 Jul 2016 13:42:29 +0530
>
>   lga: agent Cluster Membership (CLM) integration [#1638] Description:
>
>   Form CLM integration is supported from Log Service A.02.02.
>
>   At-least a A.02.02 LGA client will check CLM membership status of 
> client's
>   node. old LGA clients A.02.01 are always clm member.
>
>   This patch enhanced the log service for Unavailability of the Log 
> Service
>   API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>
>   After this patch the Log Service does not provide service to processes 
> on
>   cluster nodes that are not in the cluster membership.
>
>   If the node rejoins the cluster membership, processes executing on the 
> node
>   will be able to reinitialize new library handles and use the entire set 
> of
>   Log Service APIs that operate on these new handles; however, invocation 
> of
>   APIs that operate on handles acquired by any process before the node 
> left
>   the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
> with
>   the special treatment described above for asynchronous calls) with the
>   exception of saLogFinalize(), which is used to free the library handles 
> and
>   all resources associated with these handles. Hence, it is recommended 
> for
>   the processes to finalize the library handles as soon as the processes
>   detect that the node left the membership.
>
>   Detailed README will be provide soon.
>
>   Following are expected Log Service API behavior :
>
>   Case1: On Non-Member Node, Log Service API will fail with code
>   SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
> Non-
>   Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE 
> (31)
>   Case3: Non-Member Node + (Headless) Log Service API will fail with code
>   SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + 
> (Head
>   Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)
>
> changeset 5b17d7c4634d65b05bb105654971bffa2f7f8d9d
> Author:   A V Mahesh 
> Date: Tue, 26 Jul 2016 13:42:41 +0530
>
>   lgs: director Cluster Membership (CLM) integration [#1638] Description:
>
>   Form CLM integration is supported from Log Service A.02.02.
>
>   At-least a A.02.02 LGA client will check CLM membership status of 
> client's
>   node. old LGA clients A.02.01 are always clm member.
>
>   This patch enhanced the log service for Unavailability of the Log 
> Service
>   API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.
>
>   After this patch the Log Service does not provide service to processes 
> on
>   cluster nodes that are not in the cluster membership.
>
>   If the node rejoins the cluster membership, processes executing on the 
> node
>   will be able to reinitialize new library handles and use the entire set 
> of
>   Log Service APIs that operate on these new handles; however, invocation 
> of
>   APIs that operate on handles acquired by any process before the node 
> left
>   the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
> with
>   the special treatment described above for asynchronous calls) with the
>   exception of saLogFinalize(), which is used to free the library handles 
> and
>   all resources associated with these handles. Hence, it is recommended 
> for
>   the processes to finalize the library handles as soon as the processes
>   detect that the node left the membership.
>
>   Detailed README will be provide soon.
>
>   Following are expected Log Service API behavior :
>
>   Case1: On Non-Member Node, Log Service API will fail with code
>   SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
> Non-
>   Member Node, Log Service API will fail with code 

[devel] [PATCH 2 of 3] lgs: director Cluster Membership (CLM) integration [#1638]

2016-07-26 Thread mahesh . valla
 osaf/services/saf/logsv/lgs/Makefile.am |4 +-
 osaf/services/saf/logsv/lgs/lgs.h   |5 +
 osaf/services/saf/logsv/lgs/lgs_cb.h|   15 +++
 osaf/services/saf/logsv/lgs/lgs_evt.cc  |  142 
 osaf/services/saf/logsv/lgs/lgs_evt.h   |1 +
 osaf/services/saf/logsv/lgs/lgs_main.cc |   29 ++
 osaf/services/saf/logsv/lgs/lgs_mds.cc  |   41 -
 osaf/services/saf/logsv/lgs/lgs_util.cc |   83 ++
 8 files changed, 317 insertions(+), 3 deletions(-)


Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of client's node.
 old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log Service API 
on a
Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes on 
cluster nodes that are not
in the cluster membership.

If the node rejoins the cluster membership, processes executing on the node 
will be
able to reinitialize new library handles and use the entire set of Log Service 
APIs that
operate on these new handles; however, invocation of APIs that operate on 
handles
acquired by any process before the node left the membership will continue to 
fail with
SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above for
asynchronous calls) with the exception of saLogFinalize(), which is used to 
free the
library handles and all resources associated with these handles. Hence, it is 
recommended
for the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node,  Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case2: On Member Node after recovered from Non-Member Node, Log Service API 
will fail with code SA_AIS_ERR_UNAVAILABLE (31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API will 
fail with code SA_AIS_ERR_UNAVAILABLE (31)

diff --git a/osaf/services/saf/logsv/lgs/Makefile.am 
b/osaf/services/saf/logsv/lgs/Makefile.am
--- a/osaf/services/saf/logsv/lgs/Makefile.am
+++ b/osaf/services/saf/logsv/lgs/Makefile.am
@@ -67,7 +67,8 @@ osaflogd_SOURCES = \
lgs_mbcsv_v3.cc \
lgs_mbcsv_v5.cc \
lgs_recov.cc \
-   lgs_imm_gcfg.cc
+   lgs_imm_gcfg.cc \
+   lgs_clm.cc
 
 osaflogd_LDADD = \
$(top_builddir)/osaf/tools/safimm/src/libimmutil.la \
@@ -75,4 +76,5 @@ osaflogd_LDADD = \
$(top_builddir)/osaf/libs/saf/libSaAmf/libSaAmf.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOi.la \
$(top_builddir)/osaf/libs/saf/libSaImm/libSaImmOm.la \
+   $(top_builddir)/osaf/libs/saf/libSaClm/libSaClm.la \
$(top_builddir)/osaf/libs/agents/infrastructure/rda/librda.la
diff --git a/osaf/services/saf/logsv/lgs/lgs.h 
b/osaf/services/saf/logsv/lgs/lgs.h
--- a/osaf/services/saf/logsv/lgs/lgs.h
+++ b/osaf/services/saf/logsv/lgs/lgs.h
@@ -33,6 +33,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "saAmf.h"
 
 /* LGS files */
@@ -78,6 +79,7 @@
 #define LGS_LOG_SHARED_FILESYSTEM 1/* Use shared filesystem. 
Default */
 #define LGS_LOG_SPLIT_FILESYSTEM  2 /* Store logs on local file system on
each node */
+#define m_LGS_GET_NODE_ID_FROM_ADEST(adest) (NODE_ID) ((uint64_t)adest >> 32)
 
 /* 
  *   DATA DECLARATIONS
@@ -131,4 +133,7 @@ int lgs_get_streamobj_attr(SaImmAttrValu
   SaImmHandleT *immOmHandle);
 int lgs_free_streamobj_attr(SaImmHandleT immHandle);
 
+extern uint32_t send_clm_node_status_change(SaClmClusterChangesT 
cluster_change, NODE_ID node_id);
+extern void lgs_init_with_clm(void);
+
 #endif   /* ifndef __LGS_H */
diff --git a/osaf/services/saf/logsv/lgs/lgs_cb.h 
b/osaf/services/saf/logsv/lgs/lgs_cb.h
--- a/osaf/services/saf/logsv/lgs/lgs_cb.h
+++ b/osaf/services/saf/logsv/lgs/lgs_cb.h
@@ -21,6 +21,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -55,6 +56,11 @@ typedef struct lgs_stream_list {
 } lgs_stream_list_t;
 
 typedef struct {
+   NCS_PATRICIA_NODE patnode;
+   NODE_ID node_id;
+} lgs_clm_node_t;
+
+typedef struct {
NCS_PATRICIA_NODE pat_node;
uint32_t client_id;
uint32_t client_id_net;
@@ -73,6 +79,7 @@ typedef struct lgs_cb {
MDS_DEST vaddr; /* My identification in MDS  */
SaVersionT log_version; /* The version currently supported   */
NCS_PATRICIA_TREE client_tree;  /* LGA/Library/Client instantiation 
pat. tree */
+   NCS_PATRICIA_TREE clm_node_tree;  /* LGA/Library/Client 

[devel] [PATCH 0 of 3] Review Request for lgsv: Log Service CLM integration [#1638]

2016-07-26 Thread mahesh . valla
Summary:lgsv: Log Service CLM integration [#1638] 
Review request for Trac Ticket(s): #1638
Peer Reviewer(s): Vu, Lennar
Pull request to: 
Affected branch(es): default
Development branch: default


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 3cea257f1e7fc8570828ece564f9bfa563c0693b
Author: A V Mahesh 
Date:   Tue, 26 Jul 2016 13:42:29 +0530

lga: agent Cluster Membership (CLM) integration [#1638] Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of 
client's
node. old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log 
Service
API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes 
on
cluster nodes that are not in the cluster membership.

If the node rejoins the cluster membership, processes executing on the 
node
will be able to reinitialize new library handles and use the entire set 
of
Log Service APIs that operate on these new handles; however, invocation 
of
APIs that operate on handles acquired by any process before the node 
left
the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
with
the special treatment described above for asynchronous calls) with the
exception of saLogFinalize(), which is used to free the library handles 
and
all resources associated with these handles. Hence, it is recommended 
for
the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node, Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
Non-
Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE 
(31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + 
(Head
Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)

changeset 5b17d7c4634d65b05bb105654971bffa2f7f8d9d
Author: A V Mahesh 
Date:   Tue, 26 Jul 2016 13:42:41 +0530

lgs: director Cluster Membership (CLM) integration [#1638] Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of 
client's
node. old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log 
Service
API on a Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes 
on
cluster nodes that are not in the cluster membership.

If the node rejoins the cluster membership, processes executing on the 
node
will be able to reinitialize new library handles and use the entire set 
of
Log Service APIs that operate on these new handles; however, invocation 
of
APIs that operate on handles acquired by any process before the node 
left
the membership will continue to fail with SA_AIS_ERR_UNAVAILABLE (or 
with
the special treatment described above for asynchronous calls) with the
exception of saLogFinalize(), which is used to free the library handles 
and
all resources associated with these handles. Hence, it is recommended 
for
the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node, Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case2: On Member Node after recovered from 
Non-
Member Node, Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE 
(31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code
SA_AIS_ERR_UNAVAILABLE (31) Case4: On Non-Member Node + (Headless) + 
(Head
Joined) Log Service API will fail with code SA_AIS_ERR_UNAVAILABLE (31)

changeset a2ed962d8849f5cda326ee9de5a02019f5c06d64

[devel] [PATCH 1 of 3] lga: agent Cluster Membership (CLM) integration [#1638]

2016-07-26 Thread mahesh . valla
 osaf/libs/agents/saf/lga/lga.h |   2 +
 osaf/libs/agents/saf/lga/lga_api.c |  37 ++
 osaf/libs/agents/saf/lga/lga_mds.c |  75 ++
 osaf/libs/agents/saf/lga/lga_util.c|   2 +
 osaf/libs/common/logsv/include/lgsv_defs.h |   6 ++-
 osaf/libs/common/logsv/include/lgsv_msg.h  |  17 +-
 6 files changed, 134 insertions(+), 5 deletions(-)


Description:

Form CLM integration is supported from Log Service A.02.02.

At-least a A.02.02 LGA client will check CLM membership status of client's node.
 old LGA clients A.02.01 are always clm member.

This patch enhanced the log service for Unavailability of the Log Service API 
on a
Non-Member Node which will fail with SA_AIS_ERR_UNAVAILABLE.

After this patch the Log Service does not provide service to processes on 
cluster nodes that are not
in the cluster membership.

If the node rejoins the cluster membership, processes executing on the node 
will be
able to reinitialize new library handles and use the entire set of Log Service 
APIs that
operate on these new handles; however, invocation of APIs that operate on 
handles
acquired by any process before the node left the membership will continue to 
fail with
SA_AIS_ERR_UNAVAILABLE (or with the special treatment described above for
asynchronous calls) with the exception of saLogFinalize(), which is used to 
free the
library handles and all resources associated with these handles. Hence, it is 
recommended
for the processes to finalize the library handles as soon as the processes
detect that the node left the membership.

Detailed README will be provide soon.

Following are expected Log Service API behavior :

Case1: On Non-Member Node,  Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case2: On Member Node after recovered from Non-Member Node, Log Service API 
will fail with code SA_AIS_ERR_UNAVAILABLE (31)
Case3: Non-Member Node + (Headless) Log Service API will fail with code 
SA_AIS_ERR_UNAVAILABLE (31)
Case4: On Non-Member Node + (Headless) + (Head Joined) Log Service API will 
fail with code SA_AIS_ERR_UNAVAILABLE (31)

diff --git a/osaf/libs/agents/saf/lga/lga.h b/osaf/libs/agents/saf/lga/lga.h
--- a/osaf/libs/agents/saf/lga/lga.h
+++ b/osaf/libs/agents/saf/lga/lga.h
@@ -77,6 +77,7 @@ typedef struct lga_client_hdl_rec {
 * Set when client is initialized an all
 * streams are recovered
 */
+   bool is_stale_client;  /* Status of client based on the CLM status of 
node.*/
 } lga_client_hdl_rec_t;
 
 /* States of the server */
@@ -118,6 +119,7 @@ typedef struct {
/* LGS LGA sync params */
int lgs_sync_awaited;
NCS_SEL_OBJ lgs_sync_sel;
+   SaClmClusterChangesT clm_node_state; /*Reflects CLM status of this 
node(for future use).*/
 } lga_cb_t;
 
 /* lga_saf_api.c */
diff --git a/osaf/libs/agents/saf/lga/lga_api.c 
b/osaf/libs/agents/saf/lga/lga_api.c
--- a/osaf/libs/agents/saf/lga/lga_api.c
+++ b/osaf/libs/agents/saf/lga/lga_api.c
@@ -325,6 +325,14 @@ SaAisErrorT saLogSelectionObjectGet(SaLo
goto done;
}
 
+   /*Check CLM membership of node.*/
+if (hdl_rec->is_stale_client == true) {
+   TRACE("Node not CLM member or stale client");
+   ncshm_give_hdl(logHandle);
+   rc = SA_AIS_ERR_UNAVAILABLE;
+goto done;
+}
+
/* Obtain the selection object from the IPC queue */
sel_obj = m_NCS_IPC_GET_SEL_OBJ(_rec->mbx);
 
@@ -381,6 +389,14 @@ SaAisErrorT saLogDispatch(SaLogHandleT l
goto done;
}
 
+   /*Check CLM membership of node.*/
+ if (hdl_rec->is_stale_client == true) {
+ TRACE("Node not CLM member or stale client");
+ ncshm_give_hdl(logHandle);
+ rc = SA_AIS_ERR_UNAVAILABLE;
+ goto done;
+}
+
if ((rc = lga_hdl_cbk_dispatch(_cb, hdl_rec, dispatchFlags)) != 
SA_AIS_OK)
TRACE("LGA_DISPATCH_FAILURE");
 
@@ -776,6 +792,13 @@ SaAisErrorT saLogStreamOpen_2(SaLogHandl
ais_rc = SA_AIS_ERR_BAD_HANDLE;
goto done;
}
+   
+   /*Check CLM membership of node.*/
+if (hdl_rec->is_stale_client == true) {
+   TRACE("%s Node not CLM member or stale client", __FUNCTION__);
+   ais_rc = SA_AIS_ERR_UNAVAILABLE;
+   goto done_give_hdl;
+}
 
/***
 * Handle states
@@ -1202,6 +1225,13 @@ SaAisErrorT saLogWriteLogAsync(SaLogStre
goto done_give_hdl_stream;
}
 
+   /*Check CLM membership of node.*/
+   if (hdl_rec->is_stale_client == true) {
+   TRACE("%s Node not CLM member or stale client", __FUNCTION__);
+   ais_rc = SA_AIS_ERR_UNAVAILABLE;
+   goto done_give_hdl_all;
+   }
+
 

Re: [devel] [PATCH 1 of 1] cpsv: To update checkpoint user number for each node [#1669] V3

2016-07-26 Thread A V Mahesh
Hi Hoan,

I need to refresh ,I will setup again and provide the detailed 
reproducible steps.

-AVM

On 7/26/2016 8:41 AM, Vo Minh Hoang wrote:
> Dear Mahesh,
>
> Thank you very much for your checking.
>
> Unfortunately, I unsuccessfully reproduce this problem in our environment.
> Would you please send us the trace log of d and nd of both SC-1 and SC-2
> when error occur for investigating.
>
> For reference, here is my reproduce steps:
> 1. prepare SC-1 with patch, SC-2 without patch
> 2. create checkpoint in SC-1
> 3. open checkpoint in SC-2
> 4. immlist to get checkpoint information
> 5. unlink and close checkpoint in SC-1
> 6. immlist again to confirm its deletion
> 7. create checkpoint again in SC-1
> 8. list all replica in sharemem, there is a different here, in you error
> log, why sharemem is different between SC-1 and SC-2? In my opinion sharemem
> should be one.
> 9. immlist to check information
>
> Please tell us if I miss something.
> I am sorry for any inconvenient.
>
> Thank you and best regards.
> Hoang
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: Friday, July 15, 2016 10:26 AM
> To: Nhat Pham ; anders.wid...@ericsson.com; Nhat
> Pham ; Hoang Vo 
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1 of 1] cpsv: To update checkpoint user number for each
> node [#1669] V3
>
> Hi  Hoang /Nhat Pham,
>
>
> The basic testing with in-service upgrade(one old  controller with
> out patch and one new  controller with patch ) is corrupting the
> Writers/Readers/Openers  DB,
>
> please verify in-service upgrade test with collocated & no-collocated ckpts
> and address new issue and publish V4 patch.
>
> SC-1:/avm/opensaf_app/cpsv_applications/virtualaddr # immlist
> safCkpt=checkpoint_test77
> Name   Type Value(s)
> 
> safCkptSA_STRING_T
> safCkpt=checkpoint_test77
> saCkptCheckpointUsedSize   SA_UINT64_T 110 (0x6e)
> saCkptCheckpointSize   SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointRetDurationSA_TIME_T
> 9223372036854775807 (0x7fff, Sat Apr 12 05:17:16 2262)
> saCkptCheckpointNumWriters SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointNumReplicasSA_UINT32_T  4 (0x4)
> saCkptCheckpointNumReaders SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumOpeners SA_UINT32_T
> 4294967291 (0xfffb)
> saCkptCheckpointNumCorruptSections SA_UINT32_T  0 (0x0)
> saCkptCheckpointMaxSectionsSA_UINT32_T  1 (0x1)
> saCkptCheckpointMaxSectionSize SA_UINT64_T 2097152
> (0x20)
> saCkptCheckpointMaxSectionIdSize   SA_UINT64_T 256 (0x100)
> saCkptCheckpointCreationTimestamp  SA_TIME_T
> 14685525530 (0x146158c4278eda00, Fri Jul 15 08:45:53 2016)
> saCkptCheckpointCreationFlags  SA_UINT32_T  2 (0x2)
> SaImmAttrImplementerName   SA_STRING_T
> safCheckPointService
> SaImmAttrClassName SA_STRING_T
> SaCkptCheckpoint
> SaImmAttrAdminOwnerNameSA_STRING_T 
>
> -AVM
>
>
> On 7/13/2016 12:44 PM, A V Mahesh wrote:
>> Hi  Hoang /Nhat Pham,
>>
>> I just started testing , fowling test case is failing , I may report
>> more  as soon as I get some
>>
>> Test case 1 :
>>
>> Step 1 : saCkptCheckpointOpen  on SC-1
>>
>> SC-1:# ./node_A
>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
>> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
>> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
>> 4 saCkptCheckpointOpen  returned checkpointHandle 6272f0
>> saCkptCheckpointWrite Waiting to Read from Checkpoint 
>> saCkptCheckpointWrite Press  key to continue...
>>
>> 1 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 2 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 3 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 4 saCkptCheckpointWrite  checkpointHandle 626bf0
>> 222 saCkptCheckpointWrite  checkpointHandle 626bf0
>> saCkptCheckpointRead Waiting to Read from Checkpoint 
>> saCkptCheckpointRead Press  key to continue...
>>
>> Step 2 : saCkptCheckpointOpen  on SC-2
>>
>> SC-2:/avm/opensaf_app/cpsv_applications/virtualaddr # ./node_B
>> 0 saCkptCheckpointOpen  returned checkpointHandle 626bf0
>> 1 saCkptCheckpointOpen  returned checkpointHandle 626e70
>> 2 saCkptCheckpointOpen  returned checkpointHandle 626ff0
>> 3 saCkptCheckpointOpen  returned checkpointHandle 627170
>> 4 

Re: [devel] [PATCH 1 of 1] AMFD: Initialize CLM, NTF handle in thread [#1828]

2016-07-26 Thread minh chau
Hi Mathi,

I noticed that #1781 has moved the CLM init before amfd get assigned 
role. Would you be happy if I change amfd to make it does CLM init when 
it actually gets active/standby role?

Thanks,
Minh

On 25/07/16 11:25, minh chau wrote:
> I mean "... no objection ..."
>
> Thanks,
> Minh
>
> On 25/07/16 10:53, minh chau wrote:
>> Hi,
>>
>> I have tried to reproduce the problem in #1781, when amfd in 
>> non-member node gets assigned role, amfd initializes CLM 
>> successfully. Only sfmd, cpkt got UNAVAILABLE from 
>> saClmClusterNodeGet().
>> Ander's explanation sounds reasonably that amfd should initialize CLM 
>> after amfd get assigned role. If there's no comment on the patch and 
>> no object to Anders' suggestion till Wednesday this week, I would 
>> like to float V2 patch that incorporates Anders' suggestion.
>>
>> Thanks,
>> Minh
>> On 22/07/16 22:31, Anders Widell wrote:
>>> Yes, that's what I meant when I said that if we really do wish to 
>>> assign the STANDBY role to the directors running on a CLM locked 
>>> node, then we need to make sure CLM can differentiate between 
>>> middleware- and non-middleware clients. Middleware clients should 
>>> then not be affected by the CLM node lock.
>>>
>>> regards,
>>> Anders Widell
>>>
>>> On 07/22/2016 02:16 PM, praveen malviya wrote:
 Such a configured non-member node will be notified only for node 
 local changes in track callback and not cluster wide changes. This 
 is one reason clm lock of active controller node is not allowed by 
 CLM and AMF also rejects this in validation step.


 Thanks,
 Praveen


 On 22-Jul-16 5:11 PM, Anders Widell wrote:
> Ok good, so then we there is no problem calling 
> saClmInitialize_4() and
> saClmSelectionObjectGet() on a locked node. I checked
> saClmClusterTrack_4() and it should also be safe according to the 
> spec.
>
> I would prefer if you don't initialize the CLM and NTF handles on 
> spare
> nodes, until they actually get a STANDBY or ACTIVE assignment. One
> reason is performance - initializing a handle presumably consumes
> resources on both the spare controller node as well as in the CLM/NTF
> server running on the active node. We (currently) don't need the 
> handles
> as long as we are running as spares, so this is a waste of resources.
> But more importantly, I think it is safer to defer the initialization
> until the handles are needed. Let's suppose the spare starts up and
> keeps running for a very long time as a spare. Then - much later - 
> you
> become STANDBY or ACTIVE. Now you want to start using those 
> handles that
> you initialized way back in history. Who knows if the handles are 
> still
> working? A handle is essentially connection to a server running on
> another node. A lot of things may have happened since we 
> initialized it;
> controller switch-overs, fail-overs, software upgrades, and headless
> situations. Yes the handles ought to work - and if not, they don't 
> they
> ought to return BAD_HANDLE so that we can re-initialize them. But 
> there
> is also a small possibility that a bug causes the handle to simply 
> not
> work. A "fresh", newly initialized handle would be safer than a 
> one-year
> old handle.
>
> Do you think it would work if you defer creating these background
> threads until we get an ACTIVE/STANDBY assignment?
>
> regards,
> Anders Widell
>
> On 07/22/2016 12:20 PM, minh chau wrote:
>> Hi,
>>
>> I think Praveen's comment on #1812 was worrying about amfd hanging
>> when init with CLM, this patch does not change position of CLM
>> initialization and also it's done in thread so it will be ok?
>> Regarding Anders' comment: I did quick test, lock clm on standby
>> controller and reboot it, when it comes up it initializes with CLM
>> successfully, so it seems we won't get ERR_UNAVAILABLE on configured
>> non-member node
>> Thought that handling ERR_UNAVAILABLE should be removed in CLM 
>> init in
>> the scope of this ticket, but would it be useful in case that amfd
>> re-init CLM up on receiving BAD_HANDLE?
>>
>> Thanks,
>> Minh
>> On 20/07/16 22:06, Anders Widell wrote:
>>> Regarding ticket [#1781], I think that one requires some more
>>> thought. First of all, do we want to assign the STANDBY role to the
>>> OpenSAF directors running on a CLM locked node? If we do want a CLM
>>> locked node to become standby, then CLM ought to provide service to
>>> middleware clients running on a locked node! It must differentiate
>>> between middleware- and non-middleware clients.
>>>
>>> By the way, saClmInitialize_4() and saClmSelectionObjectGet() 
>>> should
>>> not return ERR_UNAVAILABLE on configured non-member nodes - they
>>> shall only return