Re: [devel] [PATCH 1/1] imm: sPbeRtMutations is updated even when validation for duplicate values fails [#2422]

2018-05-08 Thread Zoran Milinkovic
Hi Danh,

The block below can be rewritten to check only once and skip the check in the 
second loop:

The block:
+if ((attr->mFlags & SA_IMM_ATTR_NO_DUPLICATES) &&
+(multiattr->hasMatchingValue(tmpos))) {
+  LOG_NO(
+  "ERR_INVALID_PARAM: multivalued attr '%s' with NO_DUPLICATES 
"
+  "yet duplicate values provided in rta-update call. 
Object:'%s'.",
+  attrName.c_str(), objectName.c_str());
+  err = SA_AIS_ERR_INVALID_PARAM;
+  break;  // out of for switch
+}
+
+if (doIt) {
   multiattr->setExtraValue(tmpos);
 }

New block:

if (doIt) {
   multiattr->setExtraValue(tmpos);
 } else if ((attr->mFlags & SA_IMM_ATTR_NO_DUPLICATES) &&
(multiattr->hasMatchingValue(tmpos))) {
  LOG_NO(
  "ERR_INVALID_PARAM: multivalued attr '%s' with NO_DUPLICATES "
  "yet duplicate values provided in rta-update call. 
Object:'%s'.",
  attrName.c_str(), objectName.c_str());
  err = SA_AIS_ERR_INVALID_PARAM;
  break;  // out of for switch
}

The same code can be applied for other changes.

BR,
Zoran

-Original Message-
From: Danh Vo [mailto:danh.c...@dektech.com.au] 
Sent: den 15 mars 2018 11:54
To: ravisekhar.ko...@oracle.com; Hans Nordebäck <hans.nordeb...@ericsson.com>; 
Zoran Milinkovic <zoran.milinko...@ericsson.com>; Anders Widell 
<anders.wid...@ericsson.com>; Lennart Lund <lennart.l...@ericsson.com>; Vu Minh 
Nguyen <vu.m.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Danh Cong Vo <danh.c...@dektech.com.au>
Subject: [PATCH 1/1] imm: sPbeRtMutations is updated even when validation for 
duplicate values fails [#2422]

When immnd receives event to update persistent runtime attribute
from immd, there is 2 loops: the first loop validates the change,
the second one updates the afim object. The root cause comes from
the check (attr->mFlags & SA_IMM_ATTR_NO_DUPLICATES) which is
inside the second loop instead of the first loop. So the
validation is still passed even when the attribute does not allow
duplicate value. As a result, sPbeRtMutations is updated in the
second loop.
---
 src/imm/immnd/ImmModel.cc | 65 ++-
 1 file changed, 36 insertions(+), 29 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc
index c539fda..9f81c6b 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -18102,19 +18102,23 @@ SaAisErrorT ImmModel::rtObjectUpdate(
   err = SA_AIS_ERR_INVALID_PARAM;
   break;  // out of switch
 }
-if (doIt) {
-  osafassert(attrValue->isMultiValued());
-  ImmAttrMultiValue* multiattr = (ImmAttrMultiValue*)attrValue;
-  if ((attr->mFlags & SA_IMM_ATTR_NO_DUPLICATES) &&
-  (multiattr->hasMatchingValue(tmpos))) {
-LOG_NO(
-"ERR_INVALID_PARAM: multivalued attr '%s' with 
NO_DUPLICATES "
-"yet duplicate values provided in rta-update call. 
Object:'%s'.",
-attrName.c_str(), objectName.c_str());
-err = SA_AIS_ERR_INVALID_PARAM;
-break;  // out of for switch
-  }
 
+osafassert(attrValue->isMultiValued());
+ImmAttrMultiValue* multiattr = (ImmAttrMultiValue*)attrValue;
+eduAtValToOs(, &(p->attrValue.attrValue),
+ 
(SaImmValueTypeT)p->attrValue.attrValueType);
+
+if ((attr->mFlags & SA_IMM_ATTR_NO_DUPLICATES) &&
+(multiattr->hasMatchingValue(tmpos))) {
+  LOG_NO(
+  "ERR_INVALID_PARAM: multivalued attr '%s' with NO_DUPLICATES 
"
+  "yet duplicate values provided in rta-update call. 
Object:'%s'.",
+  attrName.c_str(), objectName.c_str());
+  err = SA_AIS_ERR_INVALID_PARAM;
+  break;  // out of for switch
+}
+
+if (doIt) {
   multiattr->setExtraValue(tmpos);
 }
   }
@@ -18128,27 +18132,30 @@ SaAisErrorT ImmModel::rtObjectUpdate(
   attrName.c_str());
   err = SA_AIS_ERR_INVALID_PARAM;
   break;  // out of switch
-} else if (doIt) {
-  osafassert(attrValue->isMultiValued());
-  ImmAttrMultiValue* multiattr = (ImmAttrMultiValue*)attrValue;
+}
 
-  IMMSV_EDU_ATTR_VAL_LIST* al = p->attrValue.attrMoreValues;
-  while (al) {
- 

Re: [devel] [PATCH 1/1] imm: fix memory leaked in immnd [#2825]

2018-04-04 Thread Zoran Milinkovic
Hi Hans,

Variable arguments with vsnprintf will work.
The size of the new buffer is resized in
if (len > errLen) {
   ...
   osafassert(vsnprintf(fmtError, len, errorString, vl) >= 0);
}
when there are variable arguments.

BR,
Zoran

-Original Message-
From: Hans Nordebäck 
Sent: den 4 april 2018 08:25
To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; Anders Widell 
<anders.wid...@ericsson.com>; ravisekhar.ko...@oracle.com; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>; Lennart Lund <lennart.l...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: fix memory leaked in immnd [#2825]

Hi Vu,

not saying that you should change now, but an alternative can be to:

instead of:

char* fmtError = (char*) malloc(errLen);
   osafassert(fmtError);

a std::vector can be used, (or a std::array if fixed size):

std::vector fmtError(errLen, 0);

    :

len = vsnprintf(fmtError.data(), errLen, errorString, args);

    :

fmtError.resize(len);

:

errStr->name.buf = strdup(fmtError.data();

   :

Another thing I noticed in the beginning of this function:

void ImmModel::setCcbErrorString(CcbInfo* ccb, const char* errorString,
  va_list vl) {
    int errLen = strlen(errorString) + 1;

does not include the length of the variable arguments, vsnprintf will work but 
the

resulting string may be cut.

/Regards HansN


On 04/04/2018 05:02 AM, Vu Minh Nguyen wrote:
> Hi Hans, Anders,
>
> Please see my responses inline, with [Vu].
>
> P.s:
> Please ignore previous email. I pressed wrong keys...
>
> Regards, Vu
>
>> -Original Message-
>> From: Anders Widell [mailto:anders.wid...@ericsson.com]
>> Sent: Tuesday, April 3, 2018 7:07 PM
>> To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Vu Minh Nguyen 
>> <vu.m.ngu...@dektech.com.au>; ravisekhar.ko...@oracle.com; 
>> zoran.milinko...@ericsson.com; lennart.l...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [PATCH 1/1] imm: fix memory leaked in immnd [#2825]
>>
>> Ack with comments. There is actually a second memory leak further 
>> down in this function:
>>
>>   char* newFmtError = (char*)realloc(fmtError, len);
>>   if (newFmtError == nullptr) {
>> TRACE_5("realloc error ,No memory ");
>> return;
>>   } else {
>>
>> When realloc returns nullptr, the original memory is left untouched 
>> (not deallocated). Thus, you need a free(fmtError) before return in 
>> the code above.
> [Vu] Thanks. I will fix this.
>> I agree with Hans that it would be better to use some RAII 
>> construction instead, so that you don't need to free() before each 
>> return - it is easy to forget. Maybe simply use std::string and 
>> resize() it to emulate malloc/realloc? You don't have to do it now 
>> but think about it as an improvement.
> [Vu] The ownership of the allocated memory later on is moved to the `global` 
> variable `ccb`.
> You can see it at following code lines:
>   if (strstr(errStr->name.buf, IMM_RESOURCE_ABORT) == errStr->name.buf) {
>free(errStr->name.buf);
>errStr->name.buf = fmtError;
>errStr->name.size = len;
>return;
>  }
>
> Or in other case:
> else {
>  (*errStrTail) = (ImmsvAttrNameList*)malloc(sizeof(ImmsvAttrNameList));
>  (*errStrTail)->next = NULL;
>  (*errStrTail)->name.size = len;
>  (*errStrTail)->name.buf = fmtError;
>}
>
> As IMMND is mixing C/C++ code, the `CccbInfo ccb` can be used in C 
> code and deallocate memory using free(), therefore I  keep using malloc() to 
> avoid mix using new/free() or malloc()/delete().
>
>> regards,
>> Anders Widell
>>
>> On 04/03/2018 01:42 PM, Hans Nordebäck wrote:
>>> Hi Vu,
>>>
>>> few minor comments below.
>>>
>>> /Thanks HansN
>>>
>>>
>>> On 04/03/2018 11:43 AM, Vu Minh Nguyen wrote:
>>>> The allocated memory is not freed before returning from the 
>>>> function ImmModel::setCcbErrorString().
>>>> ---
>>>>src/imm/immnd/ImmModel.cc | 4 +++-
>>>>1 file changed, 3 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/src/imm/immnd/ImmModel.cc
>> b/src/imm/immnd/ImmModel.cc
>>>> index f7c8fc0..e01ff8c 100644
>>>> --- a/src/imm/immnd/ImmModel.cc
>>>> +++ b/src/imm/immnd/ImmModel.cc
>>>> @@ -10910,7 +10910,6 @@ SaAisErrorT 
>>>> ImmModel::deleteObject(ObjectMap::iterator& oi, SaUint32T reqConn,
>>>>void ImmModel::setCcbErrorString(CcbInfo

Re: [devel] [PATCH 1/1] mds: improve thread safety in mdstest [#2746]

2018-03-22 Thread Zoran Milinkovic
Hi Hans,

Rwlock is good to use if you want to work in parallel in more threads and don’t 
want to alter values, or you have more heavier work to do in parallel instead 
and not only fetching values from another variable.
Here, we are talking about two threads, MDS thread and OpneSAF service/client 
side.

For something like:

+  pthread_rwlock_rdlock(_lock);

+  rsp_reqd = gl_rcvdmsginfo.rsp_reqd;

+  pthread_rwlock_unlock(_lock);
You don’t really need rwlock.

In the patch, there are some parts that rwlock is used for for loops, and I 
haven’t checked what’s in for loops. I don’t think that because of that rwlock 
is needed.

BR,
Zoran

From: Hans Nordebäck
Sent: den 22 mars 2018 14:21
To: Hoa Le <hoa...@dektech.com.au>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] mds: improve thread safety in mdstest [#2746]


Hi Hoa,

ack, I reviewed the V1 patch and it looks good and I agree on Zoran's comments 
regarding mutex instead of rwlock.

I'm waiting for the valgrind/helgrind results, so far it looks good. One 
question to Zoran, doesn't the performance

os rwlock depend on e.g. number of threads, access patterns, atomic operations 
etc. otherwise there would

be no need to have read and write locks? Say you have a large number of threads 
that are only reading

some variable(s), not atomic, and using read locks it should be able to run 
them in parallel which is not the

case with an ordinary mutex, which serializes the readings. Have you tested 
this or where comes these numbers from?

/Regards HansN

On 03/22/2018 01:47 PM, Hoa Le wrote:

Hi,

I replaced "rwlock" with "mutex" as suggested by Zoran in version 2 of the 
patch, please help review it again.

Thank you.

--

Best regards,

Hoa Le
On 03/21/2018 07:43 PM, Zoran Milinkovic wrote:

Hi,



According to the patch (I haven't checked the code), I don't see the reason for 
using rwlock. Pthread mutex will even work better than rwlock in the patch.



Reasons for using mutex:

1. Mutex is much faster than rwlock in Linux, around 10 times faster, if I 
remember correctly

2. Here, we are talking about two threads, and not more.

3. rwlock has never been used in OpenSAF before.



BR,

Zoran



-Original Message-

From: Hoa Le [mailto:hoa...@dektech.com.au]

Sent: den 21 mars 2018 11:34

To: Anders Widell 
<anders.wid...@ericsson.com><mailto:anders.wid...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com><mailto:hans.nordeb...@ericsson.com>

Cc: 
opensaf-devel@lists.sourceforge.net<mailto:opensaf-devel@lists.sourceforge.net>

Subject: [devel] [PATCH 1/1] mds: improve thread safety in mdstest [#2746]



- Correct helgrind issues in mds/apitest

---

 src/mds/apitest/mdstest.c  |   7 +-

 src/mds/apitest/mdstipc.h  |   7 +-

 src/mds/apitest/mdstipc_api.c  | 196 +

 src/mds/apitest/mdstipc_conf.c |  89 +--

 4 files changed, 234 insertions(+), 65 deletions(-)



diff --git a/src/mds/apitest/mdstest.c b/src/mds/apitest/mdstest.c

index bf6e173..3280e5b 100644

--- a/src/mds/apitest/mdstest.c

+++ b/src/mds/apitest/mdstest.c

@@ -35,6 +35,7 @@

 //#include "mdstest.h"



 SaAisErrorT rc;

+pthread_rwlock_t gl_lock;



 int mds_startup(void)

 {

@@ -83,13 +84,17 @@ int main(int argc, char **argv)

   if (suite == 999) {

   return 0;

   }

-

   if (mds_startup() != 0) {

   printf("Fail to start mds agents\n");

   return 1;

   }



+  pthread_rwlock_init(_lock, NULL);

+

   int rc = test_run(suite, tcase);

+

+  pthread_rwlock_destroy(_lock);

+

   mds_shutdown();

   return rc;

 }

diff --git a/src/mds/apitest/mdstipc.h b/src/mds/apitest/mdstipc.h

index fbb6468..9e93a17 100644

--- a/src/mds/apitest/mdstipc.h

+++ b/src/mds/apitest/mdstipc.h

@@ -145,13 +145,12 @@ typedef struct tet_mds_recvd_msg_info {

 } TET_MDS_RECVD_MSG_INFO;



 /* GLOBAL variables /

+extern _Thread_local NCSMDS_INFO svc_to_mds_info;

+extern pthread_rwlock_t gl_lock;

+

 TET_ADEST gl_tet_adest;

 TET_VDEST

 gl_tet_vdest[4]; /*change it to 6 to run VDS Redundancy: 101 for Stress*/

-NCSADA_INFO ada_info;

-NCSVDA_INFO vda_info;

-NCSMDS_INFO svc_to_mds_info;

-TET_EVENT_INFO gl_event_data;

 TET_SVC gl_tet_svc;

 TET_MDS_RECVD_MSG_INFO gl_rcvdmsginfo, gl_direct_rcvmsginfo;

 int gl_vdest_indx;

diff --git a/src/mds/apitest/mdstipc_api.c b/src/mds/apitest/mdstipc_api.c

index 5eb8bd9..3a98ecd 100644

--- a/src/mds/apitest/mdstipc_api.c

+++ b/src/mds/apitest/mdstipc_api.c

@@ -33,6 +33,28 @@ static MDS_CLIENT_MSG_FORMAT_VER gl_set_msg_fmt_ver;



 MDS_SVC_ID svc_ids[3] = {2006, 2007, 2008};



+pthread_mutex_t safe_printf_mutex = PTHREAD_MUTEX_INITIALIZER;

+_Thread_local NCSMDS_INFO s

Re: [devel] [PATCH 1/1] mds: improve thread safety in mdstest [#2746]

2018-03-21 Thread Zoran Milinkovic
Hi,

According to the patch (I haven't checked the code), I don't see the reason for 
using rwlock. Pthread mutex will even work better than rwlock in the patch.

Reasons for using mutex:
1. Mutex is much faster than rwlock in Linux, around 10 times faster, if I 
remember correctly
2. Here, we are talking about two threads, and not more.
3. rwlock has never been used in OpenSAF before.

BR,
Zoran

-Original Message-
From: Hoa Le [mailto:hoa...@dektech.com.au] 
Sent: den 21 mars 2018 11:34
To: Anders Widell ; Hans Nordebäck 

Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] mds: improve thread safety in mdstest [#2746]

- Correct helgrind issues in mds/apitest
---
 src/mds/apitest/mdstest.c  |   7 +-
 src/mds/apitest/mdstipc.h  |   7 +-
 src/mds/apitest/mdstipc_api.c  | 196 +
 src/mds/apitest/mdstipc_conf.c |  89 +--
 4 files changed, 234 insertions(+), 65 deletions(-)

diff --git a/src/mds/apitest/mdstest.c b/src/mds/apitest/mdstest.c
index bf6e173..3280e5b 100644
--- a/src/mds/apitest/mdstest.c
+++ b/src/mds/apitest/mdstest.c
@@ -35,6 +35,7 @@
 //#include "mdstest.h"
 
 SaAisErrorT rc;
+pthread_rwlock_t gl_lock;
 
 int mds_startup(void)
 {
@@ -83,13 +84,17 @@ int main(int argc, char **argv)
if (suite == 999) {
return 0;
}
-
if (mds_startup() != 0) {
printf("Fail to start mds agents\n");
return 1;
}
 
+   pthread_rwlock_init(_lock, NULL);
+
int rc = test_run(suite, tcase);
+
+   pthread_rwlock_destroy(_lock);
+
mds_shutdown();
return rc;
 }
diff --git a/src/mds/apitest/mdstipc.h b/src/mds/apitest/mdstipc.h
index fbb6468..9e93a17 100644
--- a/src/mds/apitest/mdstipc.h
+++ b/src/mds/apitest/mdstipc.h
@@ -145,13 +145,12 @@ typedef struct tet_mds_recvd_msg_info {
 } TET_MDS_RECVD_MSG_INFO;
 
 /* GLOBAL variables /
+extern _Thread_local NCSMDS_INFO svc_to_mds_info;
+extern pthread_rwlock_t gl_lock;
+
 TET_ADEST gl_tet_adest;
 TET_VDEST
 gl_tet_vdest[4]; /*change it to 6 to run VDS Redundancy: 101 for Stress*/
-NCSADA_INFO ada_info;
-NCSVDA_INFO vda_info;
-NCSMDS_INFO svc_to_mds_info;
-TET_EVENT_INFO gl_event_data;
 TET_SVC gl_tet_svc;
 TET_MDS_RECVD_MSG_INFO gl_rcvdmsginfo, gl_direct_rcvmsginfo;
 int gl_vdest_indx;
diff --git a/src/mds/apitest/mdstipc_api.c b/src/mds/apitest/mdstipc_api.c
index 5eb8bd9..3a98ecd 100644
--- a/src/mds/apitest/mdstipc_api.c
+++ b/src/mds/apitest/mdstipc_api.c
@@ -33,6 +33,28 @@ static MDS_CLIENT_MSG_FORMAT_VER gl_set_msg_fmt_ver;
 
 MDS_SVC_ID svc_ids[3] = {2006, 2007, 2008};
 
+pthread_mutex_t safe_printf_mutex = PTHREAD_MUTEX_INITIALIZER;
+_Thread_local NCSMDS_INFO svc_to_mds_info;
+
+void safe_printf(const char* format, ... ) {
+   pthread_mutex_lock(_printf_mutex);
+   va_list args;
+   va_start(args, format);
+   vfprintf(stdout, format, args);
+   va_end(args);
+   pthread_mutex_unlock(_printf_mutex);
+}
+int safe_fflush(FILE *stream) {
+   int rc = 0;
+   pthread_mutex_lock(_printf_mutex);
+   rc = fflush(stream);
+   pthread_mutex_unlock(_printf_mutex);
+   return rc;
+}
+
+#define printf safe_printf
+#define fflush safe_fflush
+
 /*/
 /SERVICE API TEST CASES   /
 /*/
@@ -363,6 +385,7 @@ void tet_svc_install_tp_10()
 {
int FAIL = 0;
SaUint32T rc;
+   NCSCONTEXT t_handle = 0;
// Creating a MxN VDEST with id = 2000
rc = create_vdest(NCS_VDEST_TYPE_MxN, 2000);
if (rc != NCSCC_RC_SUCCESS) {
@@ -373,25 +396,25 @@ void tet_svc_install_tp_10()
printf(
"\nTest case 10:Installing the External MIN service EXTMIN in a 
seperate thread and Uninstalling it here\n");
// Install thread
-   rc = tet_create_task((NCS_OS_CB)tet_vdest_install_thread,
-gl_tet_vdest[0].svc[0].task.t_handle);
+   rc = tet_create_task((NCS_OS_CB)tet_vdest_install_thread, t_handle);
if (rc != NCSCC_RC_SUCCESS) {
printf("\nFail to Install thread\n");
FAIL = 1;
}
-
// Now Release the Install Thread
-   rc = tet_release_task(gl_tet_vdest[0].svc[0].task.t_handle);
+   rc = tet_release_task(t_handle);
if (rc != NCSCC_RC_SUCCESS) {
printf("\nFail to release thread\n");
FAIL = 1;
}
 
// Counter shall be != 0
+   pthread_rwlock_rdlock(_lock);
if (gl_tet_vdest[0].svc_count == 0) {
printf("\nsvc_count == 0\n");
FAIL = 1;
};
+   pthread_rwlock_unlock(_lock);
 
// Uninstalling the above service
  

Re: [devel] [PATCH 1/1] imm: not allow creating reserved IMM class names [#2771]

2018-03-07 Thread Zoran Milinkovic
Hi Vu,

Maybe it's better if you push additional patch in #2771. You don't next to send 
the patch for the review (it's already commented and agreed  )
It will be more visible where the change is done, then pushing the change in 
the next commit.

BR,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 7 mars 2018 08:32
To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>; ravisekhar.ko...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 1/1] imm: not allow creating reserved IMM class 
names [#2771]

Hi Hans,

I agree. Thanks.

#2771 was pushed, so I will do the change in next commit.

Regards, Vu

> -Original Message-
> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
> Sent: Wednesday, March 7, 2018 2:13 PM
> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; 'Zoran Milinkovic'
> <zoran.milinko...@ericsson.com>; ravisekhar.ko...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [devel] [PATCH 1/1] imm: not allow creating reserved IMM 
> class names [#2771]
> 
> Hi Vu,
> 
> perhaps it is a bit easier to understand if you rename "len" to 
> "no_of_elements" ? /Hans
> 
> 
> On 03/07/2018 08:07 AM, Vu Minh Nguyen wrote:
> > Hi Hans,
> >
> > Your suggestion is shorter and clean. But for me, it is a bit hard 
> > to
> understand that code.
> >
> > cb->reserved_class_names = (char**)calloc(1, (len + 1) * 
> > cb->sizeof(char*));
> >
> > Looking at the above code, it says allocating an array with (len + 
> > 1) elements
> of char*. Easier to understand, I think.
> >
> > Regards, Vu
> >
> >> -Original Message-
> >> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
> >> Sent: Wednesday, March 7, 2018 1:31 PM
> >> To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Vu Minh 
> >> Nguyen <vu.m.ngu...@dektech.com.au>; ravisekhar.ko...@oracle.com
> >> Cc: opensaf-devel@lists.sourceforge.net
> >> Subject: Re: [devel] [PATCH 1/1] imm: not allow creating reserved 
> >> IMM
> class
> >> names [#2771]
> >>
> >> Hi,
> >>
> >> regarding Zoran's comment below, one question, isn't this code 
> >> redundant, regarding divide/multiply:
> >>
> >> size_t len = sizeof(default_reserved_names)/
> >>sizeof(default_reserved_names[0]);
> >>cb->reserved_class_names =
> >>(char**)calloc(1, len * sizeof(char*) + 1);
> >>
> >> instead:
> >>
> >> cb->reserved_class_names =
> >>(char**)calloc(1, sizeof(default_reserved_names) + 
> >> sizeof(char*));
> >>
> >> ?
> >>
> >> /Hans
> >>
> >> On 03/06/2018 04:35 PM, Zoran Milinkovic wrote:
> >>> Hi Vu,
> >>>
> >>> There are few things that I have found
> >>>
> >>> 1. imma_om_api.cc does not need to be changed.
> >>>
> >>> 2.
> >>> There is a wrong calculation for a new allocated memory in
> >> populate_reserved_class_names().
> >>> It is:
> >>> + cb->reserved_class_names =
> >>> + (char**)calloc(1, len * sizeof(char*) + 1);
> >>> ... but it should be...
> >>> + cb->reserved_class_names =
> >>> + (char**)calloc(1, (len + 1) * sizeof(char*));
> >>>
> >>> 3.
> >>> Both is_regular_name() and is_valid_schema_name() can be written 
> >>> in
> >> immnd_main.c file where they are used first. Also add function 
> >> definitions
> to
> >> the header immnd_init.h.
> >>> There is no need for a new files.
> >>> I would also prefix functions with "immnd_"
> >>>
> >>> Ack from me with minor comments.
> >>> No need to send the patch for another review
> >>>
> >>> Thanks,
> >>> Zoran
> >>>
> >>> -Original Message-
> >>> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> >>> Sent: den 30 januari 2018 15:24
> >>> To: Zoran Milinkovic <zoran.milinko...@ericsson.com>;
> >> ravisekhar.ko...@oracle.com
> >>> Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen
> >> <vu.m.ngu...@dektech.com.au>
> >>> Subject: [PATCH 1/1] imm: not allow creating reserved IMM cl

Re: [devel] [PATCH 1/1] imm: improve immlist printout for multiple attribute values [#2753]

2018-03-06 Thread Zoran Milinkovic
Hi Vu,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 24 januari 2018 15:47
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
ravisekhar.ko...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: improve immlist printout for multiple attribute 
values [#2753]

Have one space separated among attribute values.
---
 src/imm/tools/imm_list.c | 18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/src/imm/tools/imm_list.c b/src/imm/tools/imm_list.c index 
83c0653..7ccd710 100644
--- a/src/imm/tools/imm_list.c
+++ b/src/imm/tools/imm_list.c
@@ -141,19 +141,19 @@ static void print_attr_value(SaImmValueTypeT 
attrValueType,  {
switch (attrValueType) {
case SA_IMM_ATTR_SAINT32T:
-   printf("%d (0x%x)", *((SaInt32T *)attrValue),
+   printf("%d (0x%x) ", *((SaInt32T *)attrValue),
   *((SaInt32T *)attrValue));
break;
case SA_IMM_ATTR_SAUINT32T:
-   printf("%u (0x%x)", *((SaUint32T *)attrValue),
+   printf("%u (0x%x) ", *((SaUint32T *)attrValue),
   *((SaUint32T *)attrValue));
break;
case SA_IMM_ATTR_SAINT64T:
-   printf("%lld (0x%llx)", *((SaInt64T *)attrValue),
+   printf("%lld (0x%llx) ", *((SaInt64T *)attrValue),
   *((SaInt64T *)attrValue));
break;
case SA_IMM_ATTR_SAUINT64T:
-   printf("%llu (0x%llx)", *((SaUint64T *)attrValue),
+   printf("%llu (0x%llx) ", *((SaUint64T *)attrValue),
   *((SaUint64T *)attrValue));
break;
case SA_IMM_ATTR_SATIMET: {
@@ -163,15 +163,15 @@ static void print_attr_value(SaImmValueTypeT 
attrValueType,
 
ctime_r(, buf);
buf[strlen(buf) - 1] = '\0'; /* Remove new line */
-   printf("%llu (0x%llx, %s)", *((SaTimeT *)attrValue),
+   printf("%llu (0x%llx, %s) ", *((SaTimeT *)attrValue),
   *((SaTimeT *)attrValue), buf);
break;
}
case SA_IMM_ATTR_SAFLOATT:
-   printf("%.8g", *((SaFloatT *)attrValue));
+   printf("%.8g ", *((SaFloatT *)attrValue));
break;
case SA_IMM_ATTR_SADOUBLET:
-   printf("%.17g", *((SaDoubleT *)attrValue));
+   printf("%.17g ", *((SaDoubleT *)attrValue));
break;
case SA_IMM_ATTR_SANAMET: {
SaNameT *myNameT = (SaNameT *)attrValue; @@ -194,12 +194,12 @@ 
static void print_attr_value(SaImmValueTypeT attrValueType,
printf("%x", (int)anyp->bufferAddr[i]);
}
}
-   printf(" size(%u)", (unsigned int)anyp->bufferSize);
+   printf(" size(%u) ", (unsigned int)anyp->bufferSize);
 
break;
}
default:
-   printf("Unknown");
+   printf("Unknown ");
break;
}
 }
--
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


Re: [devel] [PATCH 1/1] imm: not allow creating reserved IMM class names [#2771]

2018-03-06 Thread Zoran Milinkovic
Hi Vu,

There are few things that I have found

1. imma_om_api.cc does not need to be changed.

2.
There is a wrong calculation for a new allocated memory in 
populate_reserved_class_names().
It is:
+   cb->reserved_class_names =
+   (char**)calloc(1, len * sizeof(char*) + 1);
... but it should be...
+   cb->reserved_class_names =
+   (char**)calloc(1, (len + 1) * sizeof(char*));

3.
Both is_regular_name() and is_valid_schema_name() can be written in 
immnd_main.c file where they are used first. Also add function definitions to 
the header immnd_init.h.
There is no need for a new files.
I would also prefix functions with "immnd_"

Ack from me with minor comments.
No need to send the patch for another review

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 30 januari 2018 15:24
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
ravisekhar.ko...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: not allow creating reserved IMM class names [#2771]

PBE will be restarted and will not be able to come up if user requests
creating IMM object class with same name of reserved ones.

This patch adds code to reject such request with SA_AIS_ERR_INVALID_PARAM.
---
 src/imm/Makefile.am|  2 +
 src/imm/agent/imma_om_api.cc   |  1 -
 .../apitest/management/test_saImmOmClassCreate_2.c | 48 +++
 src/imm/immnd/ImmModel.cc  | 55 +---
 src/imm/immnd/immnd.conf   |  9 ++
 src/imm/immnd/immnd_cb.h   |  1 +
 src/imm/immnd/immnd_common.c   | 75 
 src/imm/immnd/immnd_common.h   | 32 +++
 src/imm/immnd/immnd_evt.c  | 17 
 src/imm/immnd/immnd_main.c | 99 +-
 10 files changed, 285 insertions(+), 54 deletions(-)
 create mode 100644 src/imm/immnd/immnd_common.c
 create mode 100644 src/imm/immnd/immnd_common.h

diff --git a/src/imm/Makefile.am b/src/imm/Makefile.am
index b7e4826..099efda 100644
--- a/src/imm/Makefile.am
+++ b/src/imm/Makefile.am
@@ -163,6 +163,7 @@ noinst_HEADERS += \
src/imm/immnd/immnd.h \
src/imm/immnd/immnd_cb.h \
src/imm/immnd/immnd_init.h \
+   src/imm/immnd/immnd_common.h \
src/imm/immpbed/immpbe.h \
src/imm/tools/imm_dumper.h
 
@@ -332,6 +333,7 @@ bin_osafimmnd_CPPFLAGS = \
$(AM_CPPFLAGS)
 
 bin_osafimmnd_SOURCES = \
+   src/imm/immnd/immnd_common.c \
src/imm/immnd/immnd_amf.c \
src/imm/immnd/immnd_db.c \
src/imm/immnd/immnd_evt.c \
diff --git a/src/imm/agent/imma_om_api.cc b/src/imm/agent/imma_om_api.cc
index 7155799..a06f0ea 100644
--- a/src/imm/agent/imma_om_api.cc
+++ b/src/imm/agent/imma_om_api.cc
@@ -55,7 +55,6 @@ static bool immOmIsLoader = false;
 static const char *sysaClName = SA_IMM_ATTR_CLASS_NAME;
 static const char *sysaAdmName = SA_IMM_ATTR_ADMIN_OWNER_NAME;
 static const char *sysaImplName = SA_IMM_ATTR_IMPLEMENTER_NAME;
-
 static int imma_om_resurrect(IMMA_CB *cb, IMMA_CLIENT_NODE *cl_node,
  bool *locked);
 static SaAisErrorT imma_finalizeCcb(SaImmCcbHandleT ccbHandle,
diff --git a/src/imm/apitest/management/test_saImmOmClassCreate_2.c 
b/src/imm/apitest/management/test_saImmOmClassCreate_2.c
index 3ae4b0f..967b819 100644
--- a/src/imm/apitest/management/test_saImmOmClassCreate_2.c
+++ b/src/imm/apitest/management/test_saImmOmClassCreate_2.c
@@ -426,6 +426,46 @@ void saImmOmClassCreate_2_19(void)
safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
 }
 
+/*
+  Verify it is not allowed to create IMM object class with reserved name.
+  NOTE: As the list of reserved class names is read from the environment
+  variable IMMSV_RESERVED_CLASS_NAMES which is defined in immnd.conf file,
+  these 02 below test cases could fail if "objects" or "classes" name do
+  not exist in the list.
+ */
+void saImmOmClassCreate_with_reserved_name_01(void)
+{
+   const SaImmClassNameT className = (SaImmClassNameT) "objects";
+   SaImmAttrDefinitionT_2 attr1 = {"rdn", SA_IMM_ATTR_SANAMET,
+   SA_IMM_ATTR_CONFIG | SA_IMM_ATTR_RDN,
+   NULL};
+   const SaImmAttrDefinitionT_2 *attrDefinitions[] = {, NULL};
+
+   safassert(saImmOmInitialize(, , ),
+ SA_AIS_OK);
+   rc = saImmOmClassCreate_2(immOmHandle, className, SA_IMM_CLASS_CONFIG,
+ attrDefinitions);
+   test_validate(rc, SA_AIS_ERR_INVALID_PARAM);
+   safassert(saImmOmFinalize(immOmHandle), SA_AIS_OK);
+}
+
+void saImmOmClassCreate_with_reserved_name_02(void)
+{

Re: [devel] [PATCH 1/1] imm: return correct error code when working on more than 10000 objects [#2359]

2018-02-27 Thread Zoran Milinkovic
Hi,

I agree with Vu. You are mixing NCSCC errors with AIS errors.

Usually, when we introduce some limitation in the library, we must have the 
same limitation on the service side as well, and both checks return the same 
error code.
This is a bit tricky part. The check is on the service side in the decoding 
part which is more part of MDS than IMM.

If it's not possible to fix the service side and return ERR_INAVLID_PARAM or 
ERR_NO_RESOURCE, I would suggest to make an exception in this case and return 
ERR_INVALID_PARAM or ERR_NO_RESOURCE if the problem is caught in the library 
(so that applications does not need to restart) and return ERR_LIBRARY if the 
problem is caught on the service side (which means that some other library or 
earlier IMM library is used).
In both places (the service and the library sides) comments need to be added in 
the code to be visible that we have made an exception in this case.
So, on the service side, only comments need to be added since it already 
returns ERR_LIBRARY.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 27 februari 2018 02:27
To: 'srinivas' <srinivas.mangip...@oracle.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: return correct error code when working on more 
than 1 objects [#2359]

Hi Srinivas,

I see you added new error code type to the function ` immsv_evt_enc_name_list`.
I don't think that is a good idea to mix using 02 different returned error code 
types in one function.
(Actually,  SA_AIS_ERR_NO_RESOURCES(18) value is equal to
NCSCC_RC_NO_OBJECT(18))

And few minors are inline.

Regards, Vu

> -Original Message-
> From: srinivas [mailto:srinivas.mangip...@oracle.com]
> Sent: Tuesday, February 20, 2018 2:31 PM
> To: vu.m.ngu...@dektech.com.au; zoran.milinko...@ericsson.com
> Cc: opensaf-devel@lists.sourceforge.net; srinivas 
> <srinivas.mangip...@oracle.com>
> Subject: [PATCH 1/1] imm: return correct error code when working on 
> more than 1 objects [#2359]
> 
> ---
>  src/imm/agent/imma_proc.cc | 10 --  
> src/imm/common/immsv_evt.c |  2 +-
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc 
> index 886b50c..af8fb58 100644
> --- a/src/imm/agent/imma_proc.cc
> +++ b/src/imm/agent/imma_proc.cc
> @@ -3543,8 +3543,14 @@ SaAisErrorT imma_evt_fake_evs(IMMA_CB *cb, 
> IMMSV_EVT *i_evt, IMMSV_EVT **o_evt,
>proc_rc = immsv_evt_enc(i_evt, );
> 
>if (proc_rc != NCSCC_RC_SUCCESS) {
> -TRACE_2("ERR_LIBRARY: Failed to pre-pack");
> -rc = SA_AIS_ERR_LIBRARY;
> +if (proc_rc != SA_AIS_ERR_NO_RESOURCES) {
> +  rc = SA_AIS_ERR_LIBRARY;
> +  TRACE_2("ERR_LIBRARY: Failed to pre-pack");
> +}
> +else {
[Vu] `else` statement should be on the same line with previous `{`.
> +  rc = SA_AIS_ERR_NO_RESOURCES;
> +  TRACE_2("ERR_NO_RESOURCES: Failed to pre-pack");
> +}
>  goto fail;
>}
[Vu] Can we simplify above logic by only adding below check after ` 
immsv_evt_enc`?
if (proc_rc == NCSCC_RC_NO_OBJECT) {
  TRACE_2("ERR_NO_RESOURCES: Failed to pre-pack");
  rc = SA_AIS_ERR_NO_RESOURCES;
  goto fail;
}

> 
> diff --git a/src/imm/common/immsv_evt.c b/src/imm/common/immsv_evt.c 
> index 88c5101..aef00d4 100644
> --- a/src/imm/common/immsv_evt.c
> +++ b/src/imm/common/immsv_evt.c
> @@ -775,7 +775,7 @@ static uint32_t immsv_evt_enc_name_list(NCS_UBAID 
> *o_ub, IMMSV_OBJ_NAME_LIST *p)
> 
>   if (objs >= IMMSV_MAX_OBJECTS) {
>   LOG_ER("TOO MANY Object Names line:%u", __LINE__);
> - return NCSCC_RC_OUT_OF_MEM;
> + return SA_AIS_ERR_NO_RESOURCES;
[Vu] I don' think It is a good idea to mix using 02 different returned error 
code types.

>   }
>   return 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
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1/1] imm: immnd coredump during SYNC finalize [#2775]

2018-01-31 Thread Zoran Milinkovic
Hi Vu,

Reviewed the patch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 31 januari 2018 12:20
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: immnd coredump during SYNC finalize [#2775]

The call to saImmOiImplementerSet and saImmOiImplementerClear are allowed 
during sync.  Therefore, there is possibility the messages of these calls 
arrived at veteran nodes after finalizeSync was sent from IMMND coord but 
before finalizeSync arrived at the veterans (over fevs).

In that case, the implementer record stored in sImplementerVector database will 
then be different with the implementer record in finalizeSync and this mismatch 
caused the IMMND veterans aborted with current implementation.

This ticket adds a check to ignore that implementer record in finalizeSync as 
it is obsolete instead of terminating the veterans.
---
 src/imm/immnd/ImmModel.cc | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index 
7e27a83..8a9110b 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -19963,6 +19963,13 @@ SaAisErrorT 
ImmModel::finalizeSync(ImmsvOmFinalizeSync* req, bool isCoord,
 "according to finalizeSync. Assunimg implSet bypased finSync",
 info->mId, implName.c_str());
 explained = true;
+  } else if (info->mId == 0) {
+LOG_NO(
+"Sync-verify: Veteran node has different "
+"Implementer-id %u for implementer: %s, it is 0 "
+"according to finalizeSync. Assuming implClear bypased 
finSync",
+ii->id, implName.c_str());
+explained = true;
   } else {
 /* Here veteran claims either dead implementer, i.e. (info->mId ==
0), or different implementer, i.e. new and different info->mId,
--
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


Re: [devel] [PATCH 0/1] Review Request for imm: not allow creating reserved IMM class names [#2771]

2018-01-26 Thread Zoran Milinkovic
Hi,

I agree with you that the main check must be on the service side.

I've been thinking of adding a parameter in immnd.conf to define reserved class 
names like:
export 
RESERVED_CLASSES=classes,objects,attr_dflt,attrdef,multi_value_int,etc

This will apply as well with the coming change in IMM where any database can be 
used for PBE.
So, if someone wants to use another database, they may design database tables 
in different ways, and may have different reserved class names.

The default reserved class names should be from the default SQLite database 
that are used today.

BR,
Zoran

-Original Message-
From: and...@acm.org [mailto:anders.bjornerst...@telia.com] 
Sent: den 26 januari 2018 13:05
To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>; ravisekhar.ko...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 0/1] Review Request for imm: not allow creating 
reserved IMM class names [#2771]

Hi Vu,

If the check is for preventing a "fatal" problem, (such as the PBE *never* 
coming back up, resulting presumably sooner or later in arollback to the latest 
backup), thenI argue the check/prevention needs to at least be in the server.
It vould of course be both in the server and the library, but usually it is 
better to avoid redundant checks since it simplifies testing of such checks.

The risk with having the checks done only at the client/library side is that 
the server is left vulnerable to "bad" clients/applications.
OpenSAF has no control over the application software. Application software may 
corrupt its own memory resulting in the sending of corrupt messages. You could 
even contemplate malicious attacks exploiting such a known vulnerability if 
they manage to get access to the client side of the services.

Thus I think the server side should be made "bullet proof" as far as is 
known/possible in protecting itself expecially against faults of the maximum 
gravity, i.e. causing cyclickal restarts and where not even a cluster restart 
helps. You would have to go for a disruptive restore from backup here as I 
understand it.

As always when a new *serious* problem like this is discovered I expect that a 
regression test case will be added to the imm testing suites somewhere and to 
the system tests.

Regards
Anders Bjornerstedt




>Ursprungligt meddelande
>Från : vu.m.ngu...@dektech.com.au
>Datum : 2018-01-26 - 11:33 (GMT)
>Till : anders.bjornerst...@telia.com, ravisekhar.ko...@oracle.com, 
>zoran.milinko...@ericsson.com Kopia : 
>opensaf-devel@lists.sourceforge.net
>Ämne : Re: [devel] [PATCH 0/1] Review Request for imm: not allow 
>creating reserved IMM class names [#2771]
>
>Hi Anders Bjornerstedt,
>
>Do you mean we should move the validity check to IMMND (e.g: fevs local check) 
>or have additional check at IMMND side?
>
>I thought the check here is about validation of user's input parameters, then 
>it could be better to detect invalid ones as early as possible.
>
>Regards, Vu
>
>> -Original Message-
>> From: and...@acm.org [mailto:anders.bjornerst...@telia.com]
>> Sent: Thursday, January 25, 2018 5:32 PM
>> To: vu.m.ngu...@dektech.com.au; ravisekhar.ko...@oracle.com; 
>> zoran.milinko...@ericsson.com
>> Cc: opensaf-devel@lists.sourceforge.net
>> Subject: Re: [devel] [PATCH 0/1] Review Request for imm: not allow 
>> creating reserved IMM class names [#2771]
>> 
>> Hi,
>> 
>> I think the general principle needs to be that validity checks to 
>> eliminate the risk of introducing database inconsistency needs to be 
>> performed in the server. The server needs to protect itself from any 
>> faulty client generating "fatal" messages.
>> 
>> Thanks
>> Anders Bjornerstedt
>> 
>> 
>> 
>> 
>> >Ursprungligt meddelande
>> >Från : vu.m.ngu...@dektech.com.au
>> >Datum : 2018-01-25 - 13:54 (GMT)
>> >Till : zoran.milinko...@ericsson.com, ravisekhar.ko...@oracle.com 
>> >Kopia : opensaf-devel@lists.sourceforge.net
>> >Ämne : [devel] [PATCH 0/1] Review Request for imm: not allow 
>> >creating
>> reserved IMM class names [#2771]
>> >
>> >Summary: imm: not allow creating reserved IMM class names [#2771] 
>> >Review request for Ticket(s): 2771 Peer Reviewer(s): Zoran, Ravi 
>> >Pull request to: *** LIST THE PERSON WITH PUSH ACCESS HERE *** 
>> >Affected branch(es): develop, release Development branch: 
>> >ticket-2771 Base revision: c1daa9cc8e583d0a6024b28241f2b671bfa615d8
>> >Personal repository: git://git.code.sf.net/u/winhvu/review
>> >
>> >
>> >Impacted area   Impact y/n

Re: [devel] [PATCH 1/1] imm: fix wrong printouts and incorrect behavior of immadm/immcfg [#2751]

2018-01-24 Thread Zoran Milinkovic
Hi Vu,

Reviewed the code.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 24 januari 2018 15:02
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
ravisekhar.ko...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: fix wrong printouts and incorrect behavior of 
immadm/immcfg [#2751]

Fix wrong printouts and incorrect behavior of immadm/immcfg.
Refer to the ticket #2751 for more info.
---
 src/imm/tools/imm_admin.c | 4 ++--
 src/imm/tools/imm_cfg.c   | 7 ---
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/imm/tools/imm_admin.c b/src/imm/tools/imm_admin.c index 
040df28..db026f9 100644
--- a/src/imm/tools/imm_admin.c
+++ b/src/imm/tools/imm_admin.c
@@ -318,7 +318,7 @@ int main(int argc, char *argv[])
if (operationId != -1) {
fprintf(
stderr,
-   "Cannot set admin operation more then 
once");
+   "Cannot set admin operation more then 
once\n");
exit(EXIT_FAILURE);
}
operationId = strtoll(optarg, (char **)NULL, 10); @@ 
-332,7 +332,7 @@ int main(int argc, char *argv[])
if (operationId != -1) {
fprintf(
stderr,
-   "Cannot set admin operation more then 
once");
+   "Cannot set admin operation more then 
once\n");
exit(EXIT_FAILURE);
}
operationId = SA_IMM_PARAM_ADMOP_ID_ESC; diff --git 
a/src/imm/tools/imm_cfg.c b/src/imm/tools/imm_cfg.c index 4573063..73c5c2e 
100644
--- a/src/imm/tools/imm_cfg.c
+++ b/src/imm/tools/imm_cfg.c
@@ -403,7 +403,7 @@ new_attr_mod(const SaNameT *objectName, char *nameval, 
SaImmAttrFlagsT *flags)
error = get_attrValueType(attrDefinitions, name,
  >modAttr.attrValueType, flags);
if (error == SA_AIS_ERR_NOT_EXIST) {
-   fprintf(stderr, "Class '%s' does not exist\n", className);
+   fprintf(stderr, "Attribute '%s' does not exist\n", name);
res = -1;
goto done;
}
@@ -661,8 +661,8 @@ int object_create(const SaNameT **objectNames, const 
SaImmClassNameT className,
stderr,
"error - 
saImmOmAdminOwnerSet FAILED: %s\n",
saf_error(error));
-   goto done;
}
+   goto done;
}
}
}
@@ -2069,7 +2069,8 @@ static int imm_operation(int argc, char *argv[])
}
 
if (!transaction_mode) {
-   if (ccbHandle != -1) {
+   /* Don't apply the CCB if there is any error during CCB 
preparation */
+   if (ccbHandle != -1 && rc == 0) {
if ((error = immutil_saImmOmCcbApply(ccbHandle)) !=
SA_AIS_OK) {
if (error == SA_AIS_ERR_TIMEOUT)
--
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


Re: [devel] [PATCH 1/1] imm: fix immnd restarted during SYNC finalize [#2749]

2017-12-27 Thread Zoran Milinkovic
Hi Vu,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 27 december 2017 11:32
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: fix immnd restarted during SYNC finalize [#2749]

The call to saImmOiImplementerSet and saImmOiImplementerClear are allowed 
during sync.  Therefore, there is possibility the messages of these calls 
arrived at the sync-client after finalizeSync was sent from IMMND coord but 
before finalizeSync arrived at sync-client (over fevs).

In that case, the implementer record stored in sImplementerVector database will 
then be different with the implementer record in finalizeSync and this mismatch 
caused the IMMND sync-client restart with current implementation.

This ticket adds a check to ignore that implementer record in finalizeSync as 
it is obsolete instead of terminating the sync-client.
---
 src/imm/immnd/ImmModel.cc | 32 ++--
 1 file changed, 30 insertions(+), 2 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index 
16fd4d8..fcd354e 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -19476,10 +19476,38 @@ SaAisErrorT 
ImmModel::finalizeSync(ImmsvOmFinalizeSync* req, bool isCoord,
 "finalizeSync, ignoring",
 info->mImplementerName.c_str(), info->mId);
 continue;
+  } else if (ii->id == 0 && ii->nodeId == 0 && ii->mds_dest == 0) {
+/* Implementer set is requested just before finalizeSync, and it
+ * arrives on nodes after finalizeSync sends implementer info with
+ * all 0. So, ignore the implementer record in finalizeSync as it
+ * is obsolete.
+ */
+LOG_WA("implementerSet '%s' id: %u has arrived "
+   "after fynalizeSync broadcast and "
+   "before finalizeSync arrived to the sync-client, ignoring",
+   info->mImplementerName.c_str(), info->mId);
+continue;
+  } else if (info->mId == 0 && info->mNodeId == 0 &&
+ info->mMds_dest == 0) {
+/* Implementer clear is requested just before finalizeSync, and it
+ * arrives on nodes after finalizeSync sends implementer info with
+ * old set. So, ignore the implementer record in finalizeSync as it
+ * is obsolete.
+ */
+LOG_WA("implementerClear '%s' id: %u has arrived "
+   "after fynalizeSync broadcast and "
+   "before finalizeSync arrived to the sync-client, ignoring",
+   info->mImplementerName.c_str(), ii->id);
+continue;
   } else {
 LOG_WA(
-"Invalid implementer detected at sync client by finalizeSync -"
-" exiting");
+"Mismatched implementer '%s' detected at sync client by"
+"finalizeSync, info: id(%u, %u), nodeid(0x%x, 0x%x),"
+"mdsdest(%" PRIx64", %" PRIx64 ") - exiting",
+info->mImplementerName.c_str(),
+info->mId, ii->id,
+info->mNodeId, ii->nodeId,
+(uint64_t)info->mMds_dest, (uint64_t)ii->mds_dest);
 err = SA_AIS_ERR_BAD_OPERATION;
 goto done;
   }
--
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 1/1] imm: change log level for failing to send accept message [#2426]

2017-12-20 Thread Zoran Milinkovic
Importance log level is changed from error to warning level due to no reaction 
from IMMD.
---
 src/imm/immd/immd_evt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imm/immd/immd_evt.c b/src/imm/immd/immd_evt.c
index a0d9319..4c1999b 100644
--- a/src/imm/immd/immd_evt.c
+++ b/src/imm/immd/immd_evt.c
@@ -950,7 +950,7 @@ static void immd_accept_node(IMMD_CB *cb, 
IMMD_IMMND_INFO_NODE *node_info,
proc_rc = immd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMND,
node_info->immnd_dest, _evt);
if (proc_rc != NCSCC_RC_SUCCESS) {
-   LOG_ER("Failed to send accept message to IMMND %x",
+   LOG_WA("Failed to send accept message to IMMND %x",
   node_info->immnd_key);
goto done;
}
-- 
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 imm: change log level for failing to send accept message [#2426]

2017-12-20 Thread Zoran Milinkovic
Summary: imm: change log level for failing to send accept message [#2426]
Review request for Ticket(s): 2426
Peer Reviewer(s): Vu
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2426
Base revision: 5a520b91f37ef51ddf6fbdd97928a002e2967e0c
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 fc0757f36c0e803840fca62a06b612a82c6d6d9d
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 20 Dec 2017 14:46:31 +0100

imm: change log level for failing to send accept message [#2426]

Importance log level is changed from error to warning level due to no reaction 
from IMMD.



Complete diffstat:
--
 src/imm/immd/immd_evt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Vu


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: Restore printout format in immxml tools to maintain backward compatibility [#2728]

2017-12-14 Thread Zoran Milinkovic
Hi Nguyen,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Nguyen Luu [mailto:nguyen.tk@dektech.com.au] 
Sent: den 14 december 2017 09:24
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: Restore printout format in immxml tools to 
maintain backward compatibility [#2728]

Hi Zoran,

Please help me review this patch when possible.
The key change is the following:

@@ -409,10 +409,10 @@ class MergedImmDocument(BaseImmDocument):
  diff_classes = self.classes_parsed - len(self.classList)
  diff_objects = self.objects_parsed - len(self.objectList)
  print_info_stderr("Note! Merge ignored %d classes "
-  "(parsed: %d stored: %d)", diff_classes,
+  "(parsed:%d stored:%d)", diff_classes,
self.classes_parsed, len(self.classList))
  print_info_stderr("Note! Merge ignored %d objects "
-  "(parsed: %d stored: %d)", diff_objects,
+  "(parsed:%d stored:%d)", diff_objects,
self.objects_parsed, len(self.objectList)

Thanks,
Nguyen

On 12/5/2017 2:27 PM, Nguyen Luu wrote:
> - Restore the previous printout format in the immxml tools, which
>happened to be changed by ticket #2664 for better readability, in order
>to maintain backward-compatibility for any user scripts/tools that have
>been depending their check on the former printout.
> - Some other minor updates regarding formatting.
> ---
>   src/imm/tools/baseimm.py  | 32 +---
>   src/imm/tools/immxml-merge| 32 
>   src/imm/tools/immxml-validate | 16 
>   3 files changed, 41 insertions(+), 39 deletions(-)
>
> diff --git a/src/imm/tools/baseimm.py b/src/imm/tools/baseimm.py index 
> fe1c3ce..17e85eb 100644
> --- a/src/imm/tools/baseimm.py
> +++ b/src/imm/tools/baseimm.py
> @@ -84,7 +84,8 @@ class BaseImmDocument(object):
>   @staticmethod
>   def format_xml_file_with_xmllint(in_file_name, out_file_name):
>   """ Format xml file with xmllint """
> -trace("formatXmlFileWithXmlLint() prettify xml file:%s", 
> in_file_name)
> +trace("format_xml_file_with_xmllint() prettify xml file: %s",
> +  in_file_name)
>   
>   # "prettify" the result file with xmllint
>   # (due to inadequate python/minidom prettify functionality) 
> @@ -123,7 +124,7 @@ class BaseImmDocument(object):
>   doc = open(file_name)
>   str_list = []
>   imm_contents_tag_found = False
> -# imm_contents_tag_replaced = False
> +imm_contents_tag_replaced = False
>   for _line in doc:
>   line = _line
>   if not imm_contents_tag_found:
> @@ -140,18 +141,19 @@ class BaseImmDocument(object):
>   
>   xml_str = ' '.join(str_list)
>   
> -# if Options.schemaFilename is not None:
> -# if imm_contents_tag_replaced:
> -# print_info_stderr("Cannot validate input file '%s' with "
> -#   "schema file because of missing 
> namespace "
> -#   "specification in element "
> -#   ". \nProceeding with "
> -#   "processing of modified input data!",
> -#   file_name)
> -# else:
> -# if self.validate_xml_file(file_name) != 0:
> -# abort_script("Failed to validate the input file: %s",
> -#  file_name)
> +if Options.schemaFilename is not None:
> +if imm_contents_tag_replaced:
> +print_info_stderr("Cannot validate input file '%s' with "
> +  "schema file because of missing namespace "
> +  "specification in element "
> +  ". \nProceeding with "
> +  "processing of modified input data!",
> +  file_name)
> +else:
> +if self.validate_xml_file(file_name) != 0:
> +abort_script("Failed to validate the input file: %s",
> + file_name)
> +
>   return xml.dom.minidom.parseString(xml_str)
>   
>   @s

[devel] [PATCH 1/1] osaf: add /sbin/shutdown to sudoers file in 00-README.conf [#2729]

2017-12-05 Thread Zoran Milinkovic
/sbin/shutdown is added to /etc/sudoers for the configuration steps in 
00-README.conf
---
 00-README.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/00-README.conf b/00-README.conf
index 2a7ce96..5de2862 100644
--- a/00-README.conf
+++ b/00-README.conf
@@ -21,7 +21,7 @@ $./configure CPPFLAGS=-DRUNASROOT
 
 0) groupadd -r opensaf
 1) useradd -r -g opensaf -d /usr/local/share/opensaf/ -s /sbin/nologin -c 
"OpenSAF" opensaf
-2) echo "opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/tipc-config, 
/usr/bin/pkill, /usr/bin/killall" >> /etc/sudoers
+2) echo "opensaf ALL = NOPASSWD: /sbin/reboot, /sbin/shutdown, 
/sbin/tipc-config, /usr/bin/pkill, /usr/bin/killall" >> /etc/sudoers
 3) echo 'Defaults:%opensaf !requiretty' >> /etc/sudoers
 4) echo 'Defaults:opensaf !requiretty' >> /etc/sudoers
 5) chown opensaf /var/lib/opensaf
-- 
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 osaf: add shutdown to sudoers file in 00-README.conf [#2729]

2017-12-05 Thread Zoran Milinkovic
Summary: osaf: add /sbin/shutdown to sudoers file in 00-README.conf [#2729]
Review request for Ticket(s): 2729
Peer Reviewer(s): Vu, Hans
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2729
Base revision: 924aa6e5046621c2c299f22d1943b8f1b0148b4a
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision e7ff736355ec63b8a1dea8a592d3b61f3571d2a5
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Tue, 5 Dec 2017 14:36:53 +0100

osaf: add /sbin/shutdown to sudoers file in 00-README.conf [#2729]

/sbin/shutdown is added to /etc/sudoers for the configuration steps in 
00-README.conf



Complete diffstat:
--
 00-README.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Hans and Vu


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] clm: clmprint does not work as expected [#2651]

2017-11-14 Thread Zoran Milinkovic
Hi Vu,

Ack from me.
Please correct the output in my second comment.
You can correct it when you puch the code.

Thanks,
Zoran

From: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>
Sent: Tuesday, November 14, 2017 7:16:29 AM
To: Zoran Milinkovic
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] clm: clmprint does not work as expected [#2651]

Hi Zoran,

See my responses inline.

Regards, Vu

> -Original Message-
> From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
> Sent: Monday, November 13, 2017 9:35 PM
> To: Vu Minh Nguyen <vu.m.ngu...@dektech.com.au>
> Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen
> <vu.m.ngu...@dektech.com.au>
> Subject: RE: [PATCH 1/1] clm: clmprint does not work as expected [#2651]
>
> Hi Vu,
>
> Find my comments inline
>
> -Original Message-
> From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au]
> Sent: den 1 november 2017 12:29
> To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
> Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen
> <vu.m.ngu...@dektech.com.au>
> Subject: [PATCH 1/1] clm: clmprint does not work as expected [#2651]
>
> clmprint should exit with EXIT_FAILURE when querying non-member node.
> ---
>  src/clm/tools/clm_print.c | 34 ++
>  1 file changed, 18 insertions(+), 16 deletions(-)
>
> diff --git a/src/clm/tools/clm_print.c b/src/clm/tools/clm_print.c index
> f44aee2..25b5e35 100644
> --- a/src/clm/tools/clm_print.c
> +++ b/src/clm/tools/clm_print.c
> @@ -454,12 +454,12 @@ int main(int argc, char *argv[])
>rc = saClmClusterNodeGet_4(clm_handle, node_id,
>((timeout == -1) ? (TIME_OUT) : timeout),
> );
>if (rc == SA_AIS_ERR_NOT_EXIST) {
> - fprintf(stdout, "Node id 0x%x is not in cluster
> membership\n", node_id);
> - exit(EXIT_SUCCESS);
> + fprintf(stderr, "Node id 0x%x is not in cluster
> membership!\n",
> +node_id);
>} else if (rc == SA_AIS_ERR_UNAVAILABLE) {
> - fprintf(stdout, "error - invoking clmprint from non-
> member node\n");
> - exit(EXIT_FAILURE);
> - } else if (rc != SA_AIS_OK) {
> + fprintf(stderr, "invoking clmprint from non-member
> node!\n");
> + }
>
> [Zoran] clm_print will print two error messages if rc is ERR_NOT_EXIST or
> ERR_UNAVAILABLE. The first error message will be from the code above, and
> the second error message will be from the IF statement below.
> There is nothing wrong to put exit() in IF branches above.
[Vu] Yes. It is my intention. First message is for non-developers user who
don't care/know much about CLM APIs.
Second one is for developers - show failed API and error code.

Regarding exit(), to avoid duplicated codes, I moved `exit(EXIT_FAILURE)` to
the below IF statement.

Thanks, Vu
>
> +
> + if (rc != SA_AIS_OK) {
>fprintf(stderr, "error - clmprint::
> saClmClusterNodeGet_4 failed, rc = %d\n", rc);
>exit(EXIT_FAILURE);
>}
> @@ -470,12 +470,12 @@ int main(int argc, char *argv[])
>case 'a':
>rc = saClmClusterNodeGetAsync(clm_handle, INVOCATION_ID,
> node_id);
>if (rc == SA_AIS_ERR_NOT_EXIST) {
> - fprintf(stdout, "Node id 0x%x is not in cluster
> membership\n", node_id);
> - exit(EXIT_SUCCESS);
> + fprintf(stderr, "Node id 0x%x is not in cluster
> membership!\n",
> +node_id);
>} else if (rc == SA_AIS_ERR_UNAVAILABLE) {
> - fprintf(stdout, "error - invoking clmprint from non-
> member node\n");
> - exit(EXIT_FAILURE);
> - } else if (rc != SA_AIS_OK) {
> + fprintf(stdout, "invoking clmprint from non-member
> node!\n");
> + }
>
> [Zoran] Same as the first comment plus the fprintf() from the IF branch
for rc
> == SA_AIS_ERR_UNAVAILABLE should follow the output as other error
> messages and print to stderr output.
>
> +
> + if (rc != SA_AIS_OK) {
>fprintf(stderr, "error - clmprint ::
> saClmClusterNodeGetAsync failed, rc = %d\n", rc);
>exit(EXIT_FAILURE);
>}
> @@ -487,9 +487,10 @@ int main(int argc, char *argv[])
>clusterNotificationBuffer.numberOfItems =
> SIZE_NOTIFICATIONS;
>rc = saClmClusterTrack_4(clm_h

Re: [devel] [PATCH 1/1] clm: clmprint does not work as expected [#2651]

2017-11-13 Thread Zoran Milinkovic
Hi Vu,

Find my comments inline

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 1 november 2017 12:29
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] clm: clmprint does not work as expected [#2651]

clmprint should exit with EXIT_FAILURE when querying non-member node.
---
 src/clm/tools/clm_print.c | 34 ++
 1 file changed, 18 insertions(+), 16 deletions(-)

diff --git a/src/clm/tools/clm_print.c b/src/clm/tools/clm_print.c index 
f44aee2..25b5e35 100644
--- a/src/clm/tools/clm_print.c
+++ b/src/clm/tools/clm_print.c
@@ -454,12 +454,12 @@ int main(int argc, char *argv[])
rc = saClmClusterNodeGet_4(clm_handle, node_id,
((timeout == -1) ? (TIME_OUT) : timeout), 
);
if (rc == SA_AIS_ERR_NOT_EXIST) {
-   fprintf(stdout, "Node id 0x%x is not in cluster 
membership\n", node_id);
-   exit(EXIT_SUCCESS);
+   fprintf(stderr, "Node id 0x%x is not in cluster 
membership!\n", 
+node_id);
} else if (rc == SA_AIS_ERR_UNAVAILABLE) {
-   fprintf(stdout, "error - invoking clmprint from 
non-member node\n");
-   exit(EXIT_FAILURE);
-   } else if (rc != SA_AIS_OK) {
+   fprintf(stderr, "invoking clmprint from non-member 
node!\n");
+   }

[Zoran] clm_print will print two error messages if rc is ERR_NOT_EXIST or 
ERR_UNAVAILABLE. The first error message will be from the code above, and the 
second error message will be from the IF statement below.
There is nothing wrong to put exit() in IF branches above.

+
+   if (rc != SA_AIS_OK) {
fprintf(stderr, "error - clmprint:: 
saClmClusterNodeGet_4 failed, rc = %d\n", rc);
exit(EXIT_FAILURE);
}
@@ -470,12 +470,12 @@ int main(int argc, char *argv[])
case 'a':
rc = saClmClusterNodeGetAsync(clm_handle, INVOCATION_ID, 
node_id);
if (rc == SA_AIS_ERR_NOT_EXIST) {
-   fprintf(stdout, "Node id 0x%x is not in cluster 
membership\n", node_id);
-   exit(EXIT_SUCCESS);
+   fprintf(stderr, "Node id 0x%x is not in cluster 
membership!\n", 
+node_id);
} else if (rc == SA_AIS_ERR_UNAVAILABLE) {
-   fprintf(stdout, "error - invoking clmprint from 
non-member node\n");
-   exit(EXIT_FAILURE);
-   } else if (rc != SA_AIS_OK) {
+   fprintf(stdout, "invoking clmprint from non-member 
node!\n");
+   }

[Zoran] Same as the first comment plus the fprintf() from the IF branch for rc 
== SA_AIS_ERR_UNAVAILABLE should follow the output as other error messages and 
print to stderr output.

+
+   if (rc != SA_AIS_OK) {
fprintf(stderr, "error - clmprint :: 
saClmClusterNodeGetAsync failed, rc = %d\n", rc);
exit(EXIT_FAILURE);
}
@@ -487,9 +487,10 @@ int main(int argc, char *argv[])
clusterNotificationBuffer.numberOfItems = SIZE_NOTIFICATIONS;
rc = saClmClusterTrack_4(clm_handle, SA_TRACK_CURRENT, 
);
if (rc == SA_AIS_ERR_UNAVAILABLE) {
-   fprintf(stdout, "error - invoking clmprint from 
non-member node\n");
-   exit(EXIT_FAILURE);
-   } else if (rc != SA_AIS_OK) {
+   fprintf(stderr, "invoking clmprint from non-member 
node!\n");
+   }

[Zoran] Same here... double error messages

+
+   if (rc != SA_AIS_OK) {
fprintf(stderr, "error - clmprint:: saClmClusterTrack_4 
failed, rc = %d\n", rc);
exit(EXIT_FAILURE);
}
@@ -505,9 +506,10 @@ int main(int argc, char *argv[])
case 'm':
rc = saClmClusterTrack_4(clm_handle, trackFlags, NULL);
if (rc == SA_AIS_ERR_UNAVAILABLE) {
-   fprintf(stdout, "error - invoking clmprint from 
non-member node\n");
-   exit(EXIT_FAILURE);
-   } else if (rc != SA_AIS_OK) {
+   fprintf(stderr, "invoking clmprint from non-member 
node!\n");
+   }

[Zoran] ... and here

Thanks,
Zoran

+
+   if (rc != SA_AIS_OK) {
fprintf(stderr, "error - clmprint:: saClmClusterTrack_4 
failed, rc = %d\n", rc);
exit(EXIT_FAILURE);
}
--
1.9.1


--

[devel] [PATCH 1/1] imm: update README with IMM changes in OpenSAF 5.17.11 and rename IMM schema [#2665]

2017-11-06 Thread Zoran Milinkovic
Add two sections.
The section that describes the new flag for enabling features in 5.17.11,
and the section that describes the removal of disconnected appliers

Rename IMM schema from OpensafImm_Upgrade_5.17.10.xml to 
OpensafImm_Upgrade_5.17.11.xml
---
 samples/immsv/OpensafImm_Upgrade_5.17.10.xml | 120 ---
 samples/immsv/OpensafImm_Upgrade_5.17.11.xml | 120 +++
 src/imm/README   |  78 +
 3 files changed, 198 insertions(+), 120 deletions(-)
 delete mode 100644 samples/immsv/OpensafImm_Upgrade_5.17.10.xml
 create mode 100644 samples/immsv/OpensafImm_Upgrade_5.17.11.xml

diff --git a/samples/immsv/OpensafImm_Upgrade_5.17.10.xml 
b/samples/immsv/OpensafImm_Upgrade_5.17.10.xml
deleted file mode 100644
index fb70880..000
--- a/samples/immsv/OpensafImm_Upgrade_5.17.10.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation="SAI-AIS-IMM-XSD-A.02.13.xsd" 
xmlns:xs="http://www.w3.org/2001/XMLSchema; 
xmlns:imm="http://www.saforum.org/IMMSchema;>
-  
-SA_CONFIG
-
-  opensafImm
-  SA_NAME_T
-  SA_CONFIG
-  SA_INITIALIZED
-
-
-  maxClasses
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  1000
-
-
-  maxImplementers
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  3000
-
-
-  maxAdminowners
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  2000
-
-
-  maxCcbs
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  1
-
-
-  scAbsenceAllowed
-  SA_UINT32_T
-  SA_RUNTIME
-  SA_PERSISTENT
-  SA_CACHED
-  0
-
-
-  accessControlMode
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  0
-
-
-  authorizedGroup
-  SA_STRING_T
-  SA_CONFIG
-  SA_WRITABLE
-
-
-  longDnsAllowed
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  0
-
-
-  opensafImmSyncBatchSize
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  65223
-
-
-  opensafImmNostdFlags
-  SA_UINT32_T
-  SA_RUNTIME
-  SA_CACHED
-  0
-
-
-  opensafImmEpoch
-  SA_UINT32_T
-  SA_RUNTIME
-  SA_PERSISTENT
-  SA_CACHED
-
-
-  opensafImmClassNames
-  SA_STRING_T
-  SA_RUNTIME
-  SA_MULTI_VALUE
-  SA_PERSISTENT
-  SA_CACHED
-
-
-  minApplierTimeout
-  SA_UINT32_T
-  SA_CONFIG
-  SA_WRITABLE
-  0
-
-
-  SaImmAttrImplementerName
-  SA_STRING_T
-  SA_CONFIG
-
-
-  SaImmAttrClassName
-  SA_STRING_T
-  SA_CONFIG
-  OpensafImm
-
-
-  SaImmAttrAdminOwnerName
-  SA_STRING_T
-  SA_CONFIG
-
-  
-
diff --git a/samples/immsv/OpensafImm_Upgrade_5.17.11.xml 
b/samples/immsv/OpensafImm_Upgrade_5.17.11.xml
new file mode 100644
index 000..fb70880
--- /dev/null
+++ b/samples/immsv/OpensafImm_Upgrade_5.17.11.xml
@@ -0,0 +1,120 @@
+
+http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation="SAI-AIS-IMM-XSD-A.02.13.xsd" 
xmlns:xs="http://www.w3.org/2001/XMLSchema; 
xmlns:imm="http://www.saforum.org/IMMSchema;>
+  
+SA_CONFIG
+
+  opensafImm
+  SA_NAME_T
+  SA_CONFIG
+  SA_INITIALIZED
+
+
+  maxClasses
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  1000
+
+
+  maxImplementers
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  3000
+
+
+  maxAdminowners
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  2000
+
+
+  maxCcbs
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  1
+
+
+  scAbsenceAllowed
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_PERSISTENT
+  SA_CACHED
+  0
+
+
+  accessControlMode
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  authorizedGroup
+  SA_STRING_T
+  SA_CONFIG
+  SA_WRITABLE
+
+
+  longDnsAllowed
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  opensafImmSyncBatchSize
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  65223
+
+
+  opensafImmNostdFlags
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_CACHED
+  0
+
+
+  opensafImmEpoch
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_PERSISTENT
+  SA_CACHED
+
+
+  opensafImmClassNames
+  SA_STRING_T
+  SA_RUNTIME
+  SA_MULTI_VALUE
+  SA_PERSISTENT
+  SA_CACHED
+
+
+  minApplierTimeout
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  SaImmAttrImplementerName
+  SA_STRING_T
+  SA_CONFIG
+
+
+  SaImmAttrClassName
+  SA_STRING_T
+  SA_CONFIG
+  OpensafImm
+
+
+  SaImmAttrAdminOwnerName
+  SA_STRING_T
+  SA_CONFIG
+
+  
+
diff 

[devel] [PATCH 0/1] Review Request for imm: update README with IMM changes in OpenSAF 5.17.11 and rename IMM schema [#2665]

2017-11-06 Thread Zoran Milinkovic
Summary: imm: update README with IMM changes in OpenSAF 5.17.11 and rename IMM 
schema [#2665]
Review request for Ticket(s): 2665
Peer Reviewer(s): Vu
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2665
Base revision: 39ff6baecdda95d205d251c7fa33971dc22503c1
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 servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n

NOTE: Patch(es) contain lines longer than 80 characers

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

revision b1c4e0f471066da278eedfbe27f585a644fabeb8
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Mon, 6 Nov 2017 17:25:22 +0100

imm: update README with IMM changes in OpenSAF 5.17.11 and rename IMM schema 
[#2665]

Add two sections.
The section that describes the new flag for enabling features in 5.17.11,
and the section that describes the removal of disconnected appliers

Rename IMM schema from OpensafImm_Upgrade_5.17.10.xml to 
OpensafImm_Upgrade_5.17.11.xml



Added Files:

 samples/immsv/OpensafImm_Upgrade_5.17.11.xml


Removed Files:
--
 samples/immsv/OpensafImm_Upgrade_5.17.10.xml


Complete diffstat:
--
 samples/immsv/OpensafImm_Upgrade_5.17.10.xml | 120 ---
 samples/immsv/OpensafImm_Upgrade_5.17.11.xml | 120 +++
 src/imm/README   |  78 +
 3 files changed, 198 insertions(+), 120 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Vu


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.sourc

Re: [devel] [PATCH 1/1] imm: update README with IMM changes in OpenSAF 5.17.11 [#2665]

2017-11-03 Thread Zoran Milinkovic
Hi Vu,

That paragraph is talking about implementer names, and it's still valid.
Ticket #2579 is about appliers.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 3 november 2017 11:31
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: update README with IMM changes in OpenSAF 5.17.11 
[#2665]

Hi Zoran,

Ack with one below question. 

In README, it states:

"A word of caution about implementer names. Implementer names are to be 
re-used. They are never garbage collected by the imm service.
An implementer-name may have no current live implementer handle attached, but 
once created, it lives "forever" ready for the next attach, 
(saImmOiImplementerSet). Implementer-names could be compared to Unix port 
numbers.
"

Does it need to revise a bit due to introducing of ticket #2579?

Regards, Vu

-Original Message-----
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
Sent: Thursday, November 2, 2017 9:30 PM
To: vu.m.ngu...@dektech.com.au
Cc: opensaf-devel@lists.sourceforge.net; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Subject: [PATCH 1/1] imm: update README with IMM changes in OpenSAF 5.17.11 
[#2665]

Add two sections.
The section that describes the new flag for enabling features in 5.17.11, and 
the section that describes the removal of disconnected appliers
---
 src/imm/README | 66
++
 1 file changed, 66 insertions(+)

diff --git a/src/imm/README b/src/imm/README index 184ae63..0b108d6 100644
--- a/src/imm/README
+++ b/src/imm/README
@@ -2955,6 +2955,72 @@ In case of CLM node lock, and HEADLESS is triggered 
after CLM node lock, then CL  node is nullified. The node is considered as 
HEADLESS and all other agent functions  supported in HEADLESS are supported.
 
+Notes on upgrading to OpenSAF 5.17.11
+=
+OpenSAF 5.17.11 adds new attribute flag allowing the removal of 
+disconnected appliers (#2579). During a rolling upgrade from an earlier 
+OpenSAF release to the 5.17.11 release there will be nodes executing 
+the older release concurrently with nodes executing OpenSAF 5.17.11.
+Nodes executing the earlier release will not recognize the new 
+attribute
flag originating from nodes executing 5.17.11.
+
+Because of this upgrade issue, the new attribute flag added in OpenSAF
+5.17.11 is not allowed unless a flag is toggled on in the 
+opensafImmNostdFlags runtime attribute in the object:
+
+   opensafImm=opensafImm,safApp=safImmService.
+
+The following is the shell command:
+
+immadm -o 1 -p opensafImmNostdFlags:SA_UINT32_T:1024 \
+   opensafImm=opensafImm,safApp=safImmService
+
+This will set bit 10 of the 'opensafImmNostdFlags' runtime attribute 
+inside
the immsv.
+Operation-id '1' invoked on the object:
+
+ 'opensafImm=opensafImm,safApp=safImmService'
+
+has the meaning of 'flags-ON'. Operation-id '2' has the meaning of
'flags-OFF'.
+This flag (and possibly other relevant flags) needs to be toggled ON 
+when the upgrade to OpenSAF 5.17.11 has been successfully completed.
+This would be in some final step of the upgrade. Any cluster 
+start/restart of an OpenSAF 5.17.11 system will always automatically 
+toggle
on relevant flags.
+
+In summary:
+
+Bit 1 controls schema (imm class) changes allowed or not (normally off/0).
+Bit 2 controls OpenSAF4.1 protocols allowed or not (normally on/1).
+Bit 3 controls OpenSAF4.3 protocols allowed or not (normally on/1).
+Bit 4 controls 2PBE oneSafe2PBE, see 2PBE feature in OpenSAF4.4 above
(normally off/0).
+Bit 5 controls OpenSAF4.5 protocols allowed or not (normally on/1).
+Bit 6 controls OpenSAF4.6 protocols allowed or not (normally on/1).
+Bit 7 controls OpenSAF4.7 protocols allowed or not (normally on/1).
+Bit 8 controls OpenSAF5.0 protocols allowed or not (normally on/1).
+Bit 9 controls OpenSAF5.1 protocols allowed or not (normally on/1).
+Bit 10 controls OpenSAF5.17.11 protocols allowed or not (normally on/1).
+
+Removal of disconnected applier (5.17.11) 
+=
+Once an implementer is created, it resides in the system to the cluster 
+restart. There is no way to remove implementers from the system.
+Applier is a special case of implementers and the same feature applies 
+to
appliers.
+
+Applier names usually contain the node name where they are created to 
+avoid the collision with the same appliers on other nodes. In systems 
+where new nodes come with new names every time, this can be a problem 
+and the limit of
+3000 implementer and appliers can be reached.
+
+The new feature is introduced in 5.17.11 which will handle the time for 
+keeping disconnected appliers in the system. When the time expires, 
+disconnected appliers will be removed from the system.
+
+The applier timeout is configurable, and it is set in the new attr

[devel] [PATCH 1/1] imm: update README with IMM changes in OpenSAF 5.17.11 [#2665]

2017-11-02 Thread Zoran Milinkovic
Add two sections.
The section that describes the new flag for enabling features in 5.17.11,
and the section that describes the removal of disconnected appliers
---
 src/imm/README | 66 ++
 1 file changed, 66 insertions(+)

diff --git a/src/imm/README b/src/imm/README
index 184ae63..0b108d6 100644
--- a/src/imm/README
+++ b/src/imm/README
@@ -2955,6 +2955,72 @@ In case of CLM node lock, and HEADLESS is triggered 
after CLM node lock, then CL
 node is nullified. The node is considered as HEADLESS and all other agent 
functions 
 supported in HEADLESS are supported.
 
+Notes on upgrading to OpenSAF 5.17.11
+=
+OpenSAF 5.17.11 adds new attribute flag allowing the removal of disconnected
+appliers (#2579). During a rolling upgrade from an earlier OpenSAF release
+to the 5.17.11 release there will be nodes executing the older release 
concurrently
+with nodes executing OpenSAF 5.17.11. Nodes executing the earlier release will 
not
+recognize the new attribute flag originating from nodes executing 5.17.11.
+
+Because of this upgrade issue, the new attribute flag added in OpenSAF 5.17.11 
is
+not allowed unless a flag is toggled on in the opensafImmNostdFlags runtime
+attribute in the object:
+
+   opensafImm=opensafImm,safApp=safImmService.
+
+The following is the shell command:
+
+immadm -o 1 -p opensafImmNostdFlags:SA_UINT32_T:1024 \
+   opensafImm=opensafImm,safApp=safImmService
+
+This will set bit 10 of the 'opensafImmNostdFlags' runtime attribute inside 
the immsv.
+Operation-id '1' invoked on the object:
+
+ 'opensafImm=opensafImm,safApp=safImmService'
+
+has the meaning of 'flags-ON'. Operation-id '2' has the meaning of 'flags-OFF'.
+This flag (and possibly other relevant flags) needs to be toggled ON when the 
upgrade
+to OpenSAF 5.17.11 has been successfully completed. This would be in some 
final step of
+the upgrade. Any cluster start/restart of an OpenSAF 5.17.11 system will always
+automatically toggle on relevant flags.
+
+In summary:
+
+Bit 1 controls schema (imm class) changes allowed or not (normally off/0).
+Bit 2 controls OpenSAF4.1 protocols allowed or not (normally on/1).
+Bit 3 controls OpenSAF4.3 protocols allowed or not (normally on/1).
+Bit 4 controls 2PBE oneSafe2PBE, see 2PBE feature in OpenSAF4.4 above 
(normally off/0).
+Bit 5 controls OpenSAF4.5 protocols allowed or not (normally on/1).
+Bit 6 controls OpenSAF4.6 protocols allowed or not (normally on/1).
+Bit 7 controls OpenSAF4.7 protocols allowed or not (normally on/1).
+Bit 8 controls OpenSAF5.0 protocols allowed or not (normally on/1).
+Bit 9 controls OpenSAF5.1 protocols allowed or not (normally on/1).
+Bit 10 controls OpenSAF5.17.11 protocols allowed or not (normally on/1).
+
+Removal of disconnected applier (5.17.11)
+=
+Once an implementer is created, it resides in the system to the cluster
+restart. There is no way to remove implementers from the system. Applier is
+a special case of implementers and the same feature applies to appliers.
+
+Applier names usually contain the node name where they are created to avoid
+the collision with the same appliers on other nodes. In systems where new
+nodes come with new names every time, this can be a problem and the limit of
+3000 implementer and appliers can be reached.
+
+The new feature is introduced in 5.17.11 which will handle the time for
+keeping disconnected appliers in the system. When the time expires,
+disconnected appliers will be removed from the system.
+
+The applier timeout is configurable, and it is set in the new attribute
+minApplierTimeout in IMM object. If minApplierTimeout attribute is set to 0,
+the removal of disconnected appliers is disabled. The unit in counting
+the timeout is in seconds.
+
+To be possible to use this new feature, bit 10 must be set in
+opensafImmNostdFlags attribute in IMM object.
+
 
 DEPENDENCIES
 
-- 
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 imm: update README with IMM changes in OpenSAF 5.17.11 [#2665]

2017-11-02 Thread Zoran Milinkovic
Summary: imm: update README with IMM changes in OpenSAF 5.17.11 [#2665]
Review request for Ticket(s): 2665
Peer Reviewer(s): Vu, Rafael
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2665
Base revision: 36be8313c70f110d1245fc76980b53c7ea45770a
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision e9e63b8ee8486063421c1063d6155b91fb78307e
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Thu, 2 Nov 2017 15:12:38 +0100

imm: update README with IMM changes in OpenSAF 5.17.11 [#2665]

Add two sections.
The section that describes the new flag for enabling features in 5.17.11,
and the section that describes the removal of disconnected appliers



Complete diffstat:
--
 src/imm/README | 66 ++
 1 file changed, 66 insertions(+)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Vu and Rafael


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: improve the cascade delete [#2667]

2017-11-01 Thread Zoran Milinkovic
IMMND will reduce the number of object deleted messages to PBE with sending 
only one message containing the root object name instead of sending one message 
for each delete object.
---
 src/imm/common/immpbe_dump.cc | 541 ++
 src/imm/immnd/ImmModel.cc |  18 +-
 src/imm/immnd/ImmModel.h  |   3 +-
 src/imm/immnd/immnd_evt.c | 217 -
 4 files changed, 557 insertions(+), 222 deletions(-)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
index 11af674..98aa267 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -67,8 +67,6 @@ void pbeClosePrepareTrans() {
 
 static std::string *sPbeFileName;
 
-#define SQL_STMT_SIZE 31
-
 enum {
   /* INSERT */
   SQL_INS_OBJECTS_INT_MULTI = 0,
@@ -104,7 +102,21 @@ enum {
   SQL_DEL_OBJ_TEXT_MULTI_VAL,
   SQL_DEL_CCB_COMMITS,
   /* UPDATE */
-  SQL_UPD_OBJECTS
+  SQL_UPD_OBJECTS,
+  /* INMEMORY DB */
+  SQL_MEM_SEL_DEL_OBJ_CLASSES,
+  SQL_MEM_INS_REVERSE_DN,
+  SQL_MEM_INS_DEL_OBJ,
+  SQL_MEM_DEL_OBJECTS,
+  SQL_MEM_DEL_OBJECT,
+  SQL_MEM_DEL_OBJ_INT_MULTI_ID,
+  SQL_MEM_DEL_OBJ_REAL_MULTI_ID,
+  SQL_MEM_DEL_OBJ_TEXT_MULTI_ID,
+  SQL_MEM_DEL_REVERSE_DN,
+  SQL_MEM_DEL_DELETE_OBJ,
+
+  /* enum size */
+  SQL_STMT_SIZE
 };
 
 static const char *preparedSql[] = {
@@ -142,7 +154,24 @@ static const char *preparedSql[] = {
 "DELETE FROM objects_text_multi WHERE obj_id = ? AND attr_name = ? AND 
text_val = ?",
 "DELETE FROM ccb_commits WHERE epoch <= ?",
 /* UPDATE */
-"UPDATE objects SET last_ccb = ? WHERE obj_id = ?"};
+"UPDATE objects SET last_ccb = ? WHERE obj_id = ?",
+/* INMEMORY DB */
+"SELECT class_name FROM mem.delete_obj GROUP BY class_name",
+"INSERT INTO mem.reverse_dn VALUES (?, ?)",
+"INSERT INTO mem.delete_obj SELECT r.obj_id, c.class_name "
+"FROM mem.reverse_dn r INNER JOIN objects o ON o.obj_id = r.obj_id "
+"INNER JOIN classes c on c.class_id = o.class_id "
+"WHERE r.rev_dn = ? OR r.rev_dn LIKE ?",
+"DELETE FROM objects WHERE obj_id IN (SELECT obj_id FROM mem.delete_obj)",
+"DELETE FROM mem.reverse_dn WHERE obj_id = ?",
+
+"DELETE FROM objects_int_multi WHERE obj_id IN (SELECT obj_id FROM 
mem.delete_obj)",
+"DELETE FROM objects_real_multi WHERE obj_id IN (SELECT obj_id FROM 
mem.delete_obj)",
+"DELETE FROM objects_text_multi WHERE obj_id IN (SELECT obj_id FROM 
mem.delete_obj)",
+
+"DELETE FROM mem.reverse_dn WHERE obj_id IN (SELECT obj_id FROM 
mem.delete_obj)",
+"DELETE FROM mem.delete_obj"
+};
 
 static sqlite3_stmt *preparedStmt[SQL_STMT_SIZE] = {NULL};
 
@@ -546,6 +575,152 @@ void pbeAtomicSwitchFile(const char *filePath, 
std::string localTmpFilename) {
   }
 }
 
+static std::string reverseDn(std::string ) {
+  std::string revdn;
+  std::string rdn;
+  char ch[2];
+  int escape = 0;
+
+  ch[1] = 0;
+  for(size_t i=0; i

[devel] [PATCH 0/1] Review Request for imm: improve the cascade delete [#2667]

2017-11-01 Thread Zoran Milinkovic
Summary: imm: improve the cascade delete [#2667]
Review request for Ticket(s): 2667
Peer Reviewer(s): Vu
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2667
Base revision: 36be8313c70f110d1245fc76980b53c7ea45770a
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision ce29d3b5a78f4d250ff39d9fc8b60c53191c35c3
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 1 Nov 2017 15:35:50 +0100

imm: improve the cascade delete [#2667]

IMMND will reduce the number of object deleted messages to PBE with sending 
only one message containing the root object name instead of sending one message 
for each delete object.



Complete diffstat:
--
 src/imm/common/immpbe_dump.cc | 541 ++
 src/imm/immnd/ImmModel.cc |  18 +-
 src/imm/immnd/ImmModel.h  |   3 +-
 src/imm/immnd/immnd_evt.c | 217 -
 4 files changed, 557 insertions(+), 222 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Test a massive cascade delete with more than 1 objects.
The best test would be with over 10 and 20 objects.


Conditions of Submission:
-
Ack from Vu


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] clm: add new admin operations [#2649]

2017-10-27 Thread Zoran Milinkovic
Hi Hans,

Find my comments inline

-Original Message-
From: Hans Nordebäck 
Sent: den 27 oktober 2017 15:01
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] clm: add new admin operations [#2649]

Hi Zoran,

ack, code review and some tests run. A few comments/questions:

1) Why is osafclm_stop placed in two directories?

   /usr/local/lib/opensaf/clm-scripts/osafclm_stop
  /usr/local/lib/opensaf/osafclm_stop

[Zoran] I'll fix Makefile.am before I push the patch

2) Perhaps extend the comment in clms_imm_admin_op_callback() to:

/* Section for handling cluster operations.
      * E.g.
  * cluster reboot:
  *    immadm -o 4 safCluster=myClmCluster
  * node reboot:
  *    immadm -o 4 safNode=SC-2,safCluster=myClmCluster
  *
  * node stop:
  * immadm -o 5 -p saClmAction:SA_STRING_T:stop 
safNode=SC-2,safCluster=myClmCluster
  *
  * cluster stop:
  * immadm -o 5 -p saClmAction:SA_STRING_T:stop safCluster=myClmCluster
  */

[Zoran] I'll add it to clms_imm_admin_op_callback including all admin ops.

Thanks,
Zoran

/Thanks HansN

On 10/23/2017 04:41 PM, Zoran Milinkovic wrote:
> Add two new admin operations to CLM.
> 1. Node reboot will use the same openation id as cluster reboot, but 
> the DN will contain CLM node
>
> Example for rebooting SC2:
>   immadm -o 4 safNode=SC-2,safCluster=myClmCluster
>
> 2. Execute action on remote nodei(s) with operation id 5.
> Action is a script stored in /usr/lib/opensaf/clm-scripts directory 
> started with prefix "osafclm_"
> The action name needs to be provided by saClmAction parameter, which is 
> type of SaStringT.
> If the targeted DN is CLM node, the action will be done on the node.
> If the targeted DN is CLM cluster DN, the action will be done on all 
> nodes in the cluster.
>
> Example for executing clm-scripts/osafclm_stop script on SC-2:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safNode=SC-2,safCluster=myClmCluster
>
> Example for executing clm-scripts/osafclm_stop script on all nodes:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safCluster=myClmCluster
> ---
>   Makefile.am  |   8 ++-
>   opensaf.spec.in  |   2 +
>   scripts/clm-scripts/osafclm_stop |   4 ++
>   src/ais/include/saClm.h  |   3 +-
>   src/clm/Makefile.am  |   3 ++
>   src/clm/clmd/clms.h  |   2 +
>   src/clm/clmd/clms_imm.c  | 104 
> ---
>   src/clm/clmd/clms_mds.c  |  15 +-
>   src/clm/clmd/clms_util.c |  33 +
>   src/clm/clmnd/main.c |  80 ++
>   src/clm/common/clmsv_msg.h   |   8 +++
>   11 files changed, 253 insertions(+), 9 deletions(-)
>   create mode 100644 scripts/clm-scripts/osafclm_stop
>
> diff --git a/Makefile.am b/Makefile.am index a7548d2..3fb6b50 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -78,6 +78,7 @@ pkgconfigdir = $(libdir)/pkgconfig
>   pkgimmxmldir = $(pkgdatadir)/immxml
>   pkgimmxml_svcdir = $(pkgimmxmldir)/services
>   pkgclcclidir = $(pkglibdir)/clc-cli
> +pkgclmscriptsdir = $(pkglibdir)/clm-scripts
>   docdir = $(datadir)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
>   javadir = $(datadir)/java
>   javadocdir = $(datadir)/javadoc
> @@ -118,6 +119,7 @@ lib_libopensaf_core_la_SOURCES =
>   nodist_java_DATA =
>   nodist_osaf_execbin_SCRIPTS =
>   nodist_pkgclccli_SCRIPTS =
> +nodist_pkgclmscripts_SCRIPTS =
>   nodist_pkgsysconf_DATA =
>   noinst_HEADERS =
>   noinst_LTLIBRARIES =
> @@ -155,7 +157,8 @@ dist_osaf_execbin_SCRIPTS += \
>   $(top_srcdir)/scripts/opensaf_reboot \
>   $(top_srcdir)/scripts/opensaf_sc_active \
>   $(top_srcdir)/scripts/opensaf_scale_out \
> - $(top_srcdir)/scripts/plm_scale_out
> + $(top_srcdir)/scripts/plm_scale_out \
> + $(top_srcdir)/scripts/clm-scripts/osafclm_stop
>   
>   include $(top_srcdir)/src/ais/Makefile.am
>   include $(top_srcdir)/src/base/Makefile.am
> @@ -239,6 +242,7 @@ src/osaf/configmake.h: Makefile
>   echo '#define PKGIMMXMLDIR "$(pkgimmxmldir)"'; \
>   echo '#define PKGIMMXMLSVCDIR "$(pkgimmxml_svcdir)"'; \
>   echo '#define PKGCLCCLIDIR "$(pkgclcclidir)"'; \
> + echo '#define PKGCLMSCRIPTDIR "$(pkgclmscriptsdir)"'; \
>   echo '#define JAVADIR "$(javadir)"'; \
>   echo '#define JAVADOCDIR "$(javadocdir)"'; \
>   echo '#define LSBINITDIR "$(lsbinitdir)"'; \ @@ -325,12 +329,14 @@ 
> install-data-hook: set-default-node-config
>   @for i in $$(grep -lr -e

Re: [devel] [PATCH 1/1] clm: add new admin operations [#2649]

2017-10-27 Thread Zoran Milinkovic
Hi Anders,

Find my comments inline.

-Original Message-
From: Anders Widell 
Sent: den 27 oktober 2017 13:52
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] clm: add new admin operations [#2649]

Ack with comments:

* A possible improvement to the provided sample script is to detect if we are 
using systemd, and in such a case call the systemd command to stop OpenSAF. 
This can be implemented in a separate ticket.

[Zoran] I'll change the test script to log to syslog instead of stopping 
OpenSAF when I push the code

* We should use MDS unicast instead of broadcast to address only the affected 
node. This can be implemented in a separate ticket.

[Zoran] That was my first intention, but I couldn't find the way to use MDS 
unicast.

* We should update the clm-adm command-line tool to support this new 
functionality. This can be implemented in a separate ticket.

[Zoran] We can create a ticket for this

* We should use the functionality in base/process.h instead of calling
system() for executing the user-defined scripts (see comment in my previous 
E-mail). Probably the script should also be executed in a separate thread, at 
least if the time-out is longer than a few seconds. 
This can be implemented in a separate ticket.

[Zoran] We need a ticket for this. The patch is using the executing of scripts 
in the same way as it is used in the rest of the code.

* Because of the last bullet above, document that the user-defined scripts 
should: 1) Not rely on environment variables (including PATH) being set to any 
particular value, and 2) Must not hang indefinitely as we currently don't time 
supervise them.

[Zoran] Good point

* There is some commented-out section that has been left in the code (the 
function clms_get_client_info_by_node_id). It should be removed.

[Zoran] I'll remove it before I push the code.

Thanks,
Zoran

regards,
Anders Widell


On 10/23/2017 04:41 PM, Zoran Milinkovic wrote:
> Add two new admin operations to CLM.
> 1. Node reboot will use the same openation id as cluster reboot, but 
> the DN will contain CLM node
>
> Example for rebooting SC2:
>   immadm -o 4 safNode=SC-2,safCluster=myClmCluster
>
> 2. Execute action on remote nodei(s) with operation id 5.
> Action is a script stored in /usr/lib/opensaf/clm-scripts directory 
> started with prefix "osafclm_"
> The action name needs to be provided by saClmAction parameter, which is 
> type of SaStringT.
> If the targeted DN is CLM node, the action will be done on the node.
> If the targeted DN is CLM cluster DN, the action will be done on all 
> nodes in the cluster.
>
> Example for executing clm-scripts/osafclm_stop script on SC-2:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safNode=SC-2,safCluster=myClmCluster
>
> Example for executing clm-scripts/osafclm_stop script on all nodes:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safCluster=myClmCluster
> ---
>   Makefile.am  |   8 ++-
>   opensaf.spec.in  |   2 +
>   scripts/clm-scripts/osafclm_stop |   4 ++
>   src/ais/include/saClm.h  |   3 +-
>   src/clm/Makefile.am  |   3 ++
>   src/clm/clmd/clms.h  |   2 +
>   src/clm/clmd/clms_imm.c  | 104 
> ---
>   src/clm/clmd/clms_mds.c  |  15 +-
>   src/clm/clmd/clms_util.c |  33 +
>   src/clm/clmnd/main.c |  80 ++
>   src/clm/common/clmsv_msg.h   |   8 +++
>   11 files changed, 253 insertions(+), 9 deletions(-)
>   create mode 100644 scripts/clm-scripts/osafclm_stop
>
> diff --git a/Makefile.am b/Makefile.am index a7548d2..3fb6b50 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -78,6 +78,7 @@ pkgconfigdir = $(libdir)/pkgconfig
>   pkgimmxmldir = $(pkgdatadir)/immxml
>   pkgimmxml_svcdir = $(pkgimmxmldir)/services
>   pkgclcclidir = $(pkglibdir)/clc-cli
> +pkgclmscriptsdir = $(pkglibdir)/clm-scripts
>   docdir = $(datadir)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
>   javadir = $(datadir)/java
>   javadocdir = $(datadir)/javadoc
> @@ -118,6 +119,7 @@ lib_libopensaf_core_la_SOURCES =
>   nodist_java_DATA =
>   nodist_osaf_execbin_SCRIPTS =
>   nodist_pkgclccli_SCRIPTS =
> +nodist_pkgclmscripts_SCRIPTS =
>   nodist_pkgsysconf_DATA =
>   noinst_HEADERS =
>   noinst_LTLIBRARIES =
> @@ -155,7 +157,8 @@ dist_osaf_execbin_SCRIPTS += \
>   $(top_srcdir)/scripts/opensaf_reboot \
>   $(top_srcdir)/scripts/opensaf_sc_active \
>   $(top_srcdir)/scripts/opensaf_scale_out \
> - $(top_srcdir)/scripts/plm_scale_out
> + $(top_srcdir)/scripts/plm_scal

Re: [devel] [PATCH 2/2] clm: Make the cluster reset admin operation safe [#2451]

2017-10-26 Thread Zoran Milinkovic
Hi,

This solution is not safe and is NBC.
If a new node with earlier release join the cluster, the whole cluster will be 
rebooted.

For example, this is dangerous if a node with an older OpenSAF release reboot 
during SMF upgrade. Then the whole cluster will be restarted before the 
campaign is done.

The new generated id will not be sent from an older OpenSAF version, but it 
will be expected in this patch. This will read a random number from memory 
which can be great than the generation id on active controllers, or it may 
cause the segmentation fault.

Thanks,
Zoran

-Original Message-
From: Anders Widell [mailto:anders.wid...@ericsson.com] 
Sent: den 23 oktober 2017 15:39
To: srinivas.mangip...@oracle.com; Hans Nordebäck 
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 2/2] clm: Make the cluster reset admin operation safe 
[#2451]

Introduce a cluster genration ID which is saved on persistent local storage on
all nodes during a cluster reset. Nodes with different cluster generation IDs
are not allowed to form a cluster with each other. This addresses several
problems:

* If a node reboots very fast or very slowly, it is prevented from joining a
  cluster of remaining nodes that have not yet rebooted or nodes that have
  already rebooted.
* If the cluster reset order does not reach all nodes (e.g. due to lost
  messages, temporary connectivity problems or because the node was rebooting
  while the order was sent out), the node will be rebooted later on when
  it connects with the other nodes and discovers that cluster generation IDs
  don't match.

Note: MDS does currently not block communication to or from nodes that are not
members of the CLM cluster. The cluster reset will not be completely safe until
such a mechanism is in place.
---
 scripts/opensaf_reboot   |   4 +
 src/base/Makefile.am |   1 -
 src/clm/Makefile.am  |   6 +-
 src/clm/clmd/clms.h  |   2 +-
 src/clm/clmd/clms_cb.h   |   2 +
 src/clm/clmd/clms_evt.c  |  28 +-
 src/clm/clmd/clms_imm.c  |   5 +-
 src/clm/clmd/clms_main.c |   5 +
 src/clm/clmd/clms_mds.c  |  45 -
 src/clm/clmd/clms_util.c |  10 +-
 src/clm/clmnd/cb.h   |   8 +-
 src/clm/clmnd/evt.h  |   2 +
 src/clm/clmnd/main.c | 183 +++
 src/clm/common/clmsv_msg.h   |  14 ++-
 src/clm/common/cluster_generation.cc |  88 +
 src/clm/common/cluster_generation.h  |  62 
 16 files changed, 431 insertions(+), 34 deletions(-)
 create mode 100644 src/clm/common/cluster_generation.cc
 create mode 100644 src/clm/common/cluster_generation.h

diff --git a/scripts/opensaf_reboot b/scripts/opensaf_reboot
index 6071f7a66..bae2c052d 100644
--- a/scripts/opensaf_reboot
+++ b/scripts/opensaf_reboot
@@ -47,6 +47,10 @@ test $(id -u) -ne 0 && icmd=$(which sudo 2> /dev/null)
 
 opensaf_safe_reboot()
 {
+   # Since MDS communication is not (yet) blocked between nodes of
+   # different cluster generations, we must stop IMMND as early as possible
+   # to prevent sync from a node which is being rebooted.
+   $icmd pkill -STOP osafimmnd
logger -t "opensaf_reboot" "Rebooting local node using $icmd 
/sbin/shutdown -r now"
$icmd /sbin/shutdown -r now
 }
diff --git a/src/base/Makefile.am b/src/base/Makefile.am
index be6f757c7..af590a805 100644
--- a/src/base/Makefile.am
+++ b/src/base/Makefile.am
@@ -54,7 +54,6 @@ lib_libopensaf_core_la_SOURCES += \
src/base/ncsdlib.c \
src/base/os_defs.c \
src/base/osaf_extended_name.c \
-   src/base/osaf_gcov.c \
src/base/osaf_poll.c \
src/base/osaf_secutil.c \
src/base/osaf_time.c \
diff --git a/src/clm/Makefile.am b/src/clm/Makefile.am
index 884e39b0b..f93635ed7 100644
--- a/src/clm/Makefile.am
+++ b/src/clm/Makefile.am
@@ -31,7 +31,8 @@ lib_libclm_common_la_LDFLAGS = \
$(AM_LDFLAGS)
 
 lib_libclm_common_la_SOURCES = \
-   src/clm/common/clmsv_enc_dec.c
+   src/clm/common/clmsv_enc_dec.c \
+   src/clm/common/cluster_generation.cc
 
 nodist_EXTRA_lib_libclm_common_la_SOURCES = dummy.cc
 
@@ -83,7 +84,8 @@ noinst_HEADERS += \
src/clm/clmnd/evt.h \
src/clm/common/clmsv_defs.h \
src/clm/common/clmsv_enc_dec.h \
-   src/clm/common/clmsv_msg.h
+   src/clm/common/clmsv_msg.h \
+   src/clm/common/cluster_generation.h
 
 bin_PROGRAMS += bin/clmprint
 osaf_execbin_PROGRAMS += bin/osafclmd bin/osafclmna
diff --git a/src/clm/clmd/clms.h b/src/clm/clmd/clms.h
index 2ac69eade..519b42d9a 100644
--- a/src/clm/clmd/clms.h
+++ b/src/clm/clmd/clms.h
@@ -127,5 +127,5 @@ extern uint32_t clms_send_is_member_info(CLMS_CB *cb, 
SaClmNodeIdT node_id,
  SaBoolT member, SaBoolT 
is_configured);
 extern void 

Re: [devel] [PATCH 1/1] clm: add new admin operations [#2649]

2017-10-26 Thread Zoran Milinkovic
Hi,

base/process.h cannot be used in C code.

The patch copies the pattern for execution of all other scripts.

Thanks,
Zoran

-Original Message-
From: Anders Widell 
Sent: den 26 oktober 2017 13:35
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] clm: add new admin operations [#2649]

Hi!

I have one comment: instead of executing the custom script by calling system(), 
you should use the functionality provided in base/process.h. 
This is preferred because it executes the script with a well defined 
environment (only the PATH environment variable is set, with a fixed value). 
Otherwise, all environment variables from clmna will leak into the script. Any 
change in environment variables in clmna could then be a non-backwards 
compatible change, if the user defined script depends on the value of that 
variable. Another benefit of the base/process.h code is that it lets you 
specify a time-out. How long shall the script be allowed to execute? I think we 
ought to have a time-out for the script execution, and/or execute the script in 
a separate thread to avoid blocking the main thread in clmna. Clmna is 
responsible for starting a new election in the cluster when both system 
controllers have died, so the main thread should not be blocked for too long.

regards,

Anders Widell

On 10/23/2017 04:41 PM, Zoran Milinkovic wrote:
> Add two new admin operations to CLM.
> 1. Node reboot will use the same openation id as cluster reboot, but 
> the DN will contain CLM node
>
> Example for rebooting SC2:
>   immadm -o 4 safNode=SC-2,safCluster=myClmCluster
>
> 2. Execute action on remote nodei(s) with operation id 5.
> Action is a script stored in /usr/lib/opensaf/clm-scripts directory 
> started with prefix "osafclm_"
> The action name needs to be provided by saClmAction parameter, which is 
> type of SaStringT.
> If the targeted DN is CLM node, the action will be done on the node.
> If the targeted DN is CLM cluster DN, the action will be done on all 
> nodes in the cluster.
>
> Example for executing clm-scripts/osafclm_stop script on SC-2:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safNode=SC-2,safCluster=myClmCluster
>
> Example for executing clm-scripts/osafclm_stop script on all nodes:
>   immadm -o 5 -p saClmAction:SA_STRING_T:stop 
> safCluster=myClmCluster
> ---
>   Makefile.am  |   8 ++-
>   opensaf.spec.in  |   2 +
>   scripts/clm-scripts/osafclm_stop |   4 ++
>   src/ais/include/saClm.h  |   3 +-
>   src/clm/Makefile.am  |   3 ++
>   src/clm/clmd/clms.h  |   2 +
>   src/clm/clmd/clms_imm.c  | 104 
> ---
>   src/clm/clmd/clms_mds.c  |  15 +-
>   src/clm/clmd/clms_util.c |  33 +
>   src/clm/clmnd/main.c |  80 ++
>   src/clm/common/clmsv_msg.h   |   8 +++
>   11 files changed, 253 insertions(+), 9 deletions(-)
>   create mode 100644 scripts/clm-scripts/osafclm_stop
>
> diff --git a/Makefile.am b/Makefile.am index a7548d2..3fb6b50 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -78,6 +78,7 @@ pkgconfigdir = $(libdir)/pkgconfig
>   pkgimmxmldir = $(pkgdatadir)/immxml
>   pkgimmxml_svcdir = $(pkgimmxmldir)/services
>   pkgclcclidir = $(pkglibdir)/clc-cli
> +pkgclmscriptsdir = $(pkglibdir)/clm-scripts
>   docdir = $(datadir)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
>   javadir = $(datadir)/java
>   javadocdir = $(datadir)/javadoc
> @@ -118,6 +119,7 @@ lib_libopensaf_core_la_SOURCES =
>   nodist_java_DATA =
>   nodist_osaf_execbin_SCRIPTS =
>   nodist_pkgclccli_SCRIPTS =
> +nodist_pkgclmscripts_SCRIPTS =
>   nodist_pkgsysconf_DATA =
>   noinst_HEADERS =
>   noinst_LTLIBRARIES =
> @@ -155,7 +157,8 @@ dist_osaf_execbin_SCRIPTS += \
>   $(top_srcdir)/scripts/opensaf_reboot \
>   $(top_srcdir)/scripts/opensaf_sc_active \
>   $(top_srcdir)/scripts/opensaf_scale_out \
> - $(top_srcdir)/scripts/plm_scale_out
> + $(top_srcdir)/scripts/plm_scale_out \
> + $(top_srcdir)/scripts/clm-scripts/osafclm_stop
>   
>   include $(top_srcdir)/src/ais/Makefile.am
>   include $(top_srcdir)/src/base/Makefile.am
> @@ -239,6 +242,7 @@ src/osaf/configmake.h: Makefile
>   echo '#define PKGIMMXMLDIR "$(pkgimmxmldir)"'; \
>   echo '#define PKGIMMXMLSVCDIR "$(pkgimmxml_svcdir)"'; \
>   echo '#define PKGCLCCLIDIR "$(pkgclcclidir)"'; \
> + echo '#define PKGCLMSCRIPTDIR "$(pkgclmscriptsdir)"'; \
>   echo '#define JAVADIR "$(javadir)"'; \
> 

[devel] [PATCH 1/1] clm: replace immadm command with admin op call in clm test [#2654]

2017-10-25 Thread Zoran Milinkovic
Due to long execution of immadm in a separated thread and possible timeout in 
poll, the executing immadm command for locking, unlocking and shutting down 
nodes is replaced with calling IMM admin operation function.
---
 src/clm/apitest/clmtest.c   | 92 +
 src/clm/apitest/clmtest.h   |  4 ++
 src/clm/apitest/tet_ClmLongRdn.c| 35 +++--
 src/clm/apitest/tet_saClmClusterTrack.c | 38 ++
 4 files changed, 106 insertions(+), 63 deletions(-)

diff --git a/src/clm/apitest/clmtest.c b/src/clm/apitest/clmtest.c
index 683bfe4..5b4366f 100644
--- a/src/clm/apitest/clmtest.c
+++ b/src/clm/apitest/clmtest.c
@@ -18,6 +18,9 @@
 #include 
 #include 
 
+#include 
+#include 
+
 #include "clmtest.h"
 /* Highest supported version*/
 #define CLM_HIGHEST_SUPPORTED_VERSION  
\
@@ -32,9 +35,98 @@
{  \
'B', 0x02, 0x03\
}
+#define IMM_VERSION\
+   {  \
+   'A', 0x02, 0x0f\
+   }
 
 SaNameT node_name;
 
+static SaAisErrorT immadm(SaImmAdminOperationIdT op,
+   SaConstStringT object,
+   SaTimeT timeout) {
+   /* timeout is in seconds. If timeout is set to 0,
+* the default timeout of 60 seconds will be used */
+
+   SaVersionT immVersion = IMM_VERSION;
+   SaImmHandleT immHandle = 0;
+   SaImmAdminOwnerHandleT ownerHandle = 0;
+   const SaImmAdminOperationParamsT_2 *params[] = { NULL };
+   SaConstStringT objects[] = { object, NULL };
+   SaAisErrorT err;
+   SaAisErrorT retErr;
+
+   err = saImmOmInitialize(, NULL, );
+   if(err != SA_AIS_OK) {
+   goto done;
+   }
+
+   err = saImmOmAdminOwnerInitialize(immHandle,
+   (SaImmAdminOwnerNameT)__FUNCTION__,
+   SA_TRUE, );
+   if(err != SA_AIS_OK) {
+   goto done;
+   }
+
+   err = saImmOmAdminOwnerSet_o3(ownerHandle, objects, SA_IMM_ONE);
+   if(err != SA_AIS_OK) {
+   goto done;
+   }
+
+   timeout = (timeout) ? (timeout * SA_TIME_ONE_SECOND)
+   : SA_TIME_ONE_MINUTE;
+
+   err = saImmOmAdminOperationInvoke_o3(ownerHandle, object, 1, op,
+   params, , timeout, NULL);
+   if(err != SA_AIS_OK) {
+   goto done;
+   }
+
+   err = retErr;
+
+done:
+   if(ownerHandle) {
+   saImmOmAdminOwnerFinalize(ownerHandle);
+   }
+   if(immHandle) {
+   saImmOmFinalize(immHandle);
+   }
+   return err;
+}
+
+SaAisErrorT clm_node_unlock(const char *nodeName, int ignoreOutput) {
+   SaAisErrorT err;
+
+   err = immadm(1, nodeName, 0);
+   if(err != SA_AIS_OK && !ignoreOutput) {
+   fprintf(stderr, "immadm: node unlock failed with error: %d", 
err);
+   }
+
+   return err;
+}
+
+SaAisErrorT clm_node_lock(const char *nodeName, int ignoreOutput) {
+   SaAisErrorT err;
+
+   err = immadm(2, nodeName, 0);
+   if(err != SA_AIS_OK && !ignoreOutput) {
+   fprintf(stderr, "immadm: node lock failed with error: %d", err);
+   }
+
+   return err;
+}
+
+SaAisErrorT clm_node_shutdown(const char *nodeName, int ignoreOutput) {
+   SaAisErrorT err;
+
+   err = immadm(3, nodeName, 0);
+   if(err != SA_AIS_OK && !ignoreOutput) {
+   fprintf(stderr, "immadm: node shutdown failed with error: %d", 
err);
+   }
+
+   return err;
+}
+
 void clm_init(void)
 {
FILE *fp;
diff --git a/src/clm/apitest/clmtest.h b/src/clm/apitest/clmtest.h
index 02449a0..66590ea 100644
--- a/src/clm/apitest/clmtest.h
+++ b/src/clm/apitest/clmtest.h
@@ -39,4 +39,8 @@ extern SaClmCallbacksT clmCallbacks_1;
 extern SaSelectionObjectT selectionObject;
 extern SaNameT node_name;
 
+SaAisErrorT clm_node_unlock(const char *nodeName, int ignoreOutput);
+SaAisErrorT clm_node_lock(const char *nodeName, int ignoreOutput);
+SaAisErrorT clm_node_shutdown(const char *nodeName, int ignoreOutput);
+
 #endif  // CLM_APITEST_CLMTEST_H_
diff --git a/src/clm/apitest/tet_ClmLongRdn.c b/src/clm/apitest/tet_ClmLongRdn.c
index 53e6c1d..fdf7f0b 100644
--- a/src/clm/apitest/tet_ClmLongRdn.c
+++ b/src/clm/apitest/tet_ClmLongRdn.c
@@ -209,36 +209,15 @@ static void clmTrackCallback4(
 static SaClmCallbacksT_4 clmCallback4 = {nodeGetCallBack4, clmTrackCallback4};
 static SaClmCallbacksT clmCallback = {nodeGetCallBack, clmTrackCallback};
 
-static void unlock_node(char *nodename)
-{
-   int rc;
-   char command[1024];
-
-   // Unlock the node
-   snprintf(command, sizeof(command), "immadm -o 1 %s", nodename);
-   rc = system(command);
-   assert(rc != -1);
-}
-

[devel] [PATCH 0/1] Review Request for clm: replace immadm command with admin op call in clm test [#2654]

2017-10-25 Thread Zoran Milinkovic
Summary: clm: replace immadm command with admin op call in clm test [#2654]
Review request for Ticket(s): 2654
Peer Reviewer(s): Gary
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2654
Base revision: ee7cb901b8eb023502e3c21180afb78dd15c328b
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision 56ee9e7557c84416367e0510c0dc3023f29be9ad
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 25 Oct 2017 17:14:43 +0200

clm: replace immadm command with admin op call in clm test [#2654]

Due to long execution of immadm in a separated thread and possible timeout in 
poll, the executing immadm command for locking, unlocking and shutting down 
nodes is replaced with calling IMM admin operation function.



Complete diffstat:
--
 src/clm/apitest/clmtest.c   | 92 +
 src/clm/apitest/clmtest.h   |  4 ++
 src/clm/apitest/tet_ClmLongRdn.c| 35 +++--
 src/clm/apitest/tet_saClmClusterTrack.c | 38 ++
 4 files changed, 106 insertions(+), 63 deletions(-)


Testing Commands:
-
clmtest


Testing, Expected Results:
--
All tests must pass


Conditions of Submission:
-
Ack from Gary


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] clm: fix errors in clmprint tool [#2651]

2017-10-25 Thread Zoran Milinkovic
Hi Vu,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 25 oktober 2017 06:20
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] clm: fix errors in clmprint tool [#2651]

Fix the problems:
1) clmprint returns 0 for the error case.
2) clmprint does not handle invalid inputs.
3) clmprint does not deal with non-member node.
---
 src/clm/tools/Makefile|  18 +
 src/clm/tools/clm_print.c | 191 +++---
 2 files changed, 182 insertions(+), 27 deletions(-)  create mode 100644 
src/clm/tools/Makefile

diff --git a/src/clm/tools/Makefile b/src/clm/tools/Makefile new file mode 
100644 index 000..1e39957
--- /dev/null
+++ b/src/clm/tools/Makefile
@@ -0,0 +1,18 @@
+#  -*- OpenSAF  -*-
+#
+# Copyright Ericsson AB 2017 - All Rights Reserved.
+#
+# This program is distributed in the hope that it will be useful, but # 
+WITHOUT ANY WARRANTY; without even the implied warranty of 
+MERCHANTABILITY # or FITNESS FOR A PARTICULAR PURPOSE. This file and 
+program are licensed # under the GNU Lesser General Public License Version 
2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full 
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+all:
+   $(MAKE) -C ../../.. bin/clmprint
diff --git a/src/clm/tools/clm_print.c b/src/clm/tools/clm_print.c index 
eb01d3e..f44aee2 100644
--- a/src/clm/tools/clm_print.c
+++ b/src/clm/tools/clm_print.c
@@ -1,6 +1,7 @@
 /*  -*- OpenSAF  -*-
  *
  * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
@@ -59,9 +60,9 @@ static char *clm_step[] = {
 
 static void print_node(const SaClmClusterNodeT_4 *clusterNode)  {
-   printf("Node Info for nodeId: %u>\n",
+   printf("\nNode Info for nodeId: %u>\n",
clusterNode->nodeId);
-   printf("  Node Id: %u(%x)\n",
+   printf("  Node Id: %u(0x%x)\n",
clusterNode->nodeId, clusterNode->nodeId);
printf("  Address Family : %s\n",
clusterNode->nodeAddress.family == 1 @@ -84,6 +85,7 @@ 
static void print_node(const SaClmClusterNodeT_4 *clusterNode)
clusterNode->bootTimestamp);
printf("  Initial View Number: %llu\n",
clusterNode->initialViewNumber);
+   
+printf("<===\n\n");
 }
 
 static void  clm_node_get_callback(SaInvocationT invocation, @@ -133,7 +135,6 
@@ static void clm_track_callback(const SaClmClusterNotificationBufferT_4
print_node(>notification[i].clusterNode);
printf("  Change : %s\n",
clm_change[notificationBuffer->notification[i].clusterChange]);
-   printf("<\n\n");
}
 
if ((step == SA_CLM_CHANGE_VALIDATE) || (step == SA_CLM_CHANGE_START)) 
{ @@ -217,6 +218,93 @@ static void clm_dispatch(void)
exit(EXIT_SUCCESS);
}
 }
+
+/*
+ * Exit the program with EXIT_FAILURE if passing invalid options,
+ * update the output `bit_mask` otherwise.
+ */
+static void validate_option(const char opt, uint32_t *bit_mask) {
+   enum mask_position {
+   OPT_HELP,
+   OPT_NODEGET,
+   OPT_ASYNCGET,
+   OPT_TRACK,
+   OPT_BTRACK,
+   OPT_TIMEOUT
+   };
+
+   switch (opt) {
+   case 'n':
+   if ((*bit_mask >> OPT_NODEGET) & 1) {
+   fprintf(stderr, "error - duplicated options!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   if ((*bit_mask) && (*bit_mask ^ (1 << OPT_TIMEOUT))) {
+   fprintf(stderr, "error - multiple options!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   *bit_mask |= (1 << OPT_NODEGET);
+   break;
+
+   case 'a':
+   if ((*bit_mask >> OPT_ASYNCGET) & 1) {
+   fprintf(stderr, "error - duplicated options!\n");
+

Re: [devel] [PATCH 1/1] clm: fix errors in clmprint tool [#2651]

2017-10-24 Thread Zoran Milinkovic
Hi Vu,

Find my comments inline.

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 24 oktober 2017 10:56
To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] clm: fix errors in clmprint tool [#2651]

Fix the problems:
1) clmprint returns 0 for the error case.
2) clmprint does not handle invalid inputs.
3) clmprint does not deal with non-member node.
---
 src/clm/tools/Makefile|  18 +
 src/clm/tools/clm_print.c | 186 +++---
 2 files changed, 176 insertions(+), 28 deletions(-)
 create mode 100644 src/clm/tools/Makefile

diff --git a/src/clm/tools/Makefile b/src/clm/tools/Makefile
new file mode 100644
index 000..1e39957
--- /dev/null
+++ b/src/clm/tools/Makefile
@@ -0,0 +1,18 @@
+#  -*- OpenSAF  -*-
+#
+# Copyright Ericsson AB 2017 - All Rights Reserved.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+# under the GNU Lesser General Public License Version 2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+all:
+   $(MAKE) -C ../../.. bin/clmprint
diff --git a/src/clm/tools/clm_print.c b/src/clm/tools/clm_print.c
index eb01d3e..5d578b2 100644
--- a/src/clm/tools/clm_print.c
+++ b/src/clm/tools/clm_print.c
@@ -1,6 +1,7 @@
 /*  -*- OpenSAF  -*-
  *
  * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -23,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -59,9 +61,9 @@ static char *clm_step[] = {
 
 static void print_node(const SaClmClusterNodeT_4 *clusterNode)
 {
-   printf("Node Info for nodeId: %u>\n",
+   printf("\nNode Info for nodeId: %u>\n",
clusterNode->nodeId);
-   printf("  Node Id: %u(%x)\n",
+   printf("  Node Id: %u(0x%x)\n",
clusterNode->nodeId, clusterNode->nodeId);
printf("  Address Family : %s\n",
clusterNode->nodeAddress.family == 1
@@ -84,6 +86,7 @@ static void print_node(const SaClmClusterNodeT_4 *clusterNode)
clusterNode->bootTimestamp);
printf("  Initial View Number: %llu\n",
clusterNode->initialViewNumber);
+   printf("<===\n\n");
 }
 
 static void  clm_node_get_callback(SaInvocationT invocation,
@@ -133,7 +136,6 @@ static void clm_track_callback(const 
SaClmClusterNotificationBufferT_4
print_node(>notification[i].clusterNode);
printf("  Change : %s\n",
clm_change[notificationBuffer->notification[i].clusterChange]);
-   printf("<\n\n");
}
 
if ((step == SA_CLM_CHANGE_VALIDATE) || (step == SA_CLM_CHANGE_START)) {
@@ -217,6 +219,93 @@ static void clm_dispatch(void)
exit(EXIT_SUCCESS);
}
 }
+
+/*
+ * Exit the program with EXIT_FAILURE if passing invalid options,
+ * update the output `bit_mask` otherwise.
+ */
+void validate_option(const char opt, uint32_t *bit_mask)
+{
+   enum mask_position {
+   OPT_HELP,
+   OPT_NODEGET,
+   OPT_ASYNCGET,
+   OPT_TRACK,
+   OPT_BTRACK,
+   OPT_TIMEOUT
+   };
+
+   switch (opt) {
+   case 'n':
+   if ((*bit_mask >> OPT_NODEGET) & 1) {
+   fprintf(stderr, "error - duplicated option!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   if ((*bit_mask) && (*bit_mask ^ (1 << OPT_TIMEOUT))) {
+   fprintf(stderr, "error - multiple options!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   *bit_mask |= (1 << OPT_NODEGET);
+   break;
+
+   case 'a':
+   if ((*bit_mask >> OPT_ASYNCGET) & 1) {
+   fprintf(stderr, &q

Re: [devel] [PATCH 1/1] clm: fix return wrong error code [#2652]

2017-10-24 Thread Zoran Milinkovic
Hi Vu,

Reviewed the code.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 24 oktober 2017 09:58
To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] clm: fix return wrong error code [#2652]

saClmClusterNodeGet_4() and saClmClusterNodeGetAsync() returns
SA_AIS_ERR_UNAVAILABLE(31) when querying non-member node information from a 
member node.

According to AIS, they should return SA_AIS_ERR_NOT_EXIST.
SA_AIS_ERR_UNAVAILABLE should be returned when invoking process is not 
executing on a member node.
---
 src/clm/clmd/clms_evt.c | 27 ++-
 1 file changed, 22 insertions(+), 5 deletions(-)

diff --git a/src/clm/clmd/clms_evt.c b/src/clm/clmd/clms_evt.c index 
8352af8..4d7010d 100644
--- a/src/clm/clmd/clms_evt.c
+++ b/src/clm/clmd/clms_evt.c
@@ -1492,13 +1492,20 @@ static uint32_t proc_node_get_msg(CLMS_CB *cb, 
CLMSV_CLMS_EVT *evt)
.bootTimestamp = node->boot_time;
clm_msg.info.api_resp_info.param.node_get
.initialViewNumber = node->init_view;
-   } else {
+   } else if (local_node->member == SA_FALSE) {
clm_msg.evt_type =
CLMSV_CLMS_TO_CLMA_API_RESP_MSG;
clm_msg.info.api_resp_info.type =
CLMSV_NODE_GET_RESP;
clm_msg.info.api_resp_info.rc =
SA_AIS_ERR_UNAVAILABLE;
+   } else {
+   clm_msg.evt_type =
+   CLMSV_CLMS_TO_CLMA_API_RESP_MSG;
+   clm_msg.info.api_resp_info.type =
+   CLMSV_NODE_GET_RESP;
+   clm_msg.info.api_resp_info.rc =
+   SA_AIS_ERR_NOT_EXIST;
}
} else {
clm_msg.evt_type = CLMSV_CLMS_TO_CLMA_API_RESP_MSG; @@ 
-1508,7 +1515,7 @@ static uint32_t proc_node_get_msg(CLMS_CB *cb, 
CLMSV_CLMS_EVT *evt)
} else {
clm_msg.evt_type = CLMSV_CLMS_TO_CLMA_API_RESP_MSG;
clm_msg.info.api_resp_info.type = CLMSV_NODE_GET_RESP;
-   clm_msg.info.api_resp_info.rc = SA_AIS_ERR_NOT_EXIST;
+   clm_msg.info.api_resp_info.rc = SA_AIS_ERR_UNAVAILABLE;
}
 
TRACE_LEAVE();
@@ -1573,6 +1580,16 @@ static uint32_t proc_node_get_async_msg(CLMS_CB *cb, 
CLMSV_CLMS_EVT *evt)
ais_rc;
clm_msg.info.cbk_info.client_id =
param->client_id;
+   } else if (local_node->member == SA_FALSE) {
+   clm_msg.evt_type = CLMSV_CLMS_TO_CLMA_CBK_MSG;
+   clm_msg.info.cbk_info.type =
+   CLMSV_NODE_ASYNC_GET_CBK;
+   clm_msg.info.cbk_info.param.node_get.inv =
+   param->inv;
+   clm_msg.info.cbk_info.param.node_get.err =
+   SA_AIS_ERR_UNAVAILABLE;
+   clm_msg.info.cbk_info.client_id =
+   param->client_id;
} else {
TRACE(
"Node exists in the database but is 
non-member"); @@ -1582,7 +1599,7 @@ static uint32_t 
proc_node_get_async_msg(CLMS_CB *cb, CLMSV_CLMS_EVT *evt)
clm_msg.info.cbk_info.param.node_get.inv =
param->inv;
clm_msg.info.cbk_info.param.node_get.err =
-   SA_AIS_ERR_UNAVAILABLE;
+   SA_AIS_ERR_NOT_EXIST;
clm_msg.info.cbk_info.client_id =
param->client_id;
}
@@ -1596,11 +1613,11 @@ static uint32_t proc_node_get_async_msg(CLMS_CB *cb, 
CLMSV_CLMS_EVT *evt)
clm_msg.info.cbk_info.client_id = param->client_id;
}
} else {
-   TRACE("Node doesn't exist in the data base");
+   TRACE("Invoking process is not in cluster membership");
clm_msg.evt_type = CLMSV_CLMS_TO_CLMA_CBK_MSG;
clm_msg.info.cbk_info.type = CLMSV_NODE_

Re: [devel] [PATCH 1/1] clm: fix errors in clmprint tool [#2651]

2017-10-24 Thread Zoran Milinkovic
Hi Vu,

Find my comments inline

-Original Message-
From: Vu Minh Nguyen [mailto:vu.m.ngu...@dektech.com.au] 
Sent: den 24 oktober 2017 09:43
To: Hans Nordebäck <hans.nordeb...@ericsson.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vu Minh Nguyen 
<vu.m.ngu...@dektech.com.au>
Subject: [PATCH 1/1] clm: fix errors in clmprint tool [#2651]

Fix the problems:
1) clmprint returns 0 for the error case.
2) clmprint does not handle invalid inputs.
3) clmprint does not deal with non-member node.
---
 src/clm/tools/Makefile|  18 +
 src/clm/tools/clm_print.c | 186 +++---
 2 files changed, 178 insertions(+), 26 deletions(-)
 create mode 100644 src/clm/tools/Makefile

diff --git a/src/clm/tools/Makefile b/src/clm/tools/Makefile
new file mode 100644
index 000..de2407b
--- /dev/null
+++ b/src/clm/tools/Makefile
@@ -0,0 +1,18 @@
+#  -*- OpenSAF  -*-
+#
+# (C) Copyright 2016 The OpenSAF Foundation
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+# or FITNESS FOR A PARTICULAR PURPOSE. This file and program are licensed
+# under the GNU Lesser General Public License Version 2.1, February 1999.
+# The complete license can be accessed from the following location:
+# http://opensource.org/licenses/lgpl-license.php
+# See the Copying file included with the OpenSAF distribution for full
+# licensing terms.
+#
+# Author(s): Ericsson AB
+#
+
+all:
+   $(MAKE) -C ../../.. bin/clmprint
diff --git a/src/clm/tools/clm_print.c b/src/clm/tools/clm_print.c
index eb01d3e..09f3f34 100644
--- a/src/clm/tools/clm_print.c
+++ b/src/clm/tools/clm_print.c
@@ -1,6 +1,7 @@
 /*  -*- OpenSAF  -*-
  *
  * Copyright (C) 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright Ericsson AB 2017 - All Rights Reserved.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
@@ -23,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -59,9 +61,9 @@ static char *clm_step[] = {
 
 static void print_node(const SaClmClusterNodeT_4 *clusterNode)
 {
-   printf("Node Info for nodeId: %u>\n",
+   printf("\nNode Info for nodeId: %u>\n",
clusterNode->nodeId);
-   printf("  Node Id: %u(%x)\n",
+   printf("  Node Id: %u(0x%x)\n",
clusterNode->nodeId, clusterNode->nodeId);
printf("  Address Family : %s\n",
clusterNode->nodeAddress.family == 1
@@ -84,6 +86,7 @@ static void print_node(const SaClmClusterNodeT_4 *clusterNode)
clusterNode->bootTimestamp);
printf("  Initial View Number: %llu\n",
clusterNode->initialViewNumber);
+   printf("<===\n\n");
 }
 
 static void  clm_node_get_callback(SaInvocationT invocation,
@@ -133,7 +136,6 @@ static void clm_track_callback(const 
SaClmClusterNotificationBufferT_4
print_node(>notification[i].clusterNode);
printf("  Change : %s\n",
clm_change[notificationBuffer->notification[i].clusterChange]);
-   printf("<\n\n");
}
 
if ((step == SA_CLM_CHANGE_VALIDATE) || (step == SA_CLM_CHANGE_START)) {
@@ -217,6 +219,98 @@ static void clm_dispatch(void)
exit(EXIT_SUCCESS);
}
 }
+
+/*
+ * Exit the program with EXIT_FAILURE if passing invalid options,
+ * update the output `bit_mask` otherwise.
+ */
+void validate_option(const char opt, uint32_t *bit_mask)
+{
+   enum mask_position {
+   OPT_HELP,
+   OPT_NODEGET,
+   OPT_ASYNCGET,
+   OPT_TRACK,
+   OPT_BTRACK,
+   OPT_TIMEOUT
+   };
+
+   switch (opt) {
+   case 'n':
+   if ((*bit_mask >> OPT_NODEGET) & 1) {
+   fprintf(stderr, "error - duplicated option!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   if ((*bit_mask) && (*bit_mask ^ (1 << OPT_TIMEOUT))) {
+   fprintf(stderr, "error - multiple options!\n");
+   exit(EXIT_FAILURE);
+   }
+
+   *bit_mask |= (1 << OPT_NODEGET);
+   break;
+
+   case 'a':
+   if ((*bit_mask >> OPT_ASYNCGET) & 1) {
+   fprintf(stderr, "erro

[devel] [PATCH 1/1] clm: add new admin operations [#2649]

2017-10-23 Thread Zoran Milinkovic
Add two new admin operations to CLM.
1. Node reboot will use the same openation id as cluster reboot, but the DN 
will contain CLM node

   Example for rebooting SC2:
 immadm -o 4 safNode=SC-2,safCluster=myClmCluster

2. Execute action on remote nodei(s) with operation id 5.
   Action is a script stored in /usr/lib/opensaf/clm-scripts directory started 
with prefix "osafclm_"
   The action name needs to be provided by saClmAction parameter, which is type 
of SaStringT.
   If the targeted DN is CLM node, the action will be done on the node.
   If the targeted DN is CLM cluster DN, the action will be done on all nodes 
in the cluster.

   Example for executing clm-scripts/osafclm_stop script on SC-2:
 immadm -o 5 -p saClmAction:SA_STRING_T:stop 
safNode=SC-2,safCluster=myClmCluster

   Example for executing clm-scripts/osafclm_stop script on all nodes:
 immadm -o 5 -p saClmAction:SA_STRING_T:stop safCluster=myClmCluster
---
 Makefile.am  |   8 ++-
 opensaf.spec.in  |   2 +
 scripts/clm-scripts/osafclm_stop |   4 ++
 src/ais/include/saClm.h  |   3 +-
 src/clm/Makefile.am  |   3 ++
 src/clm/clmd/clms.h  |   2 +
 src/clm/clmd/clms_imm.c  | 104 ---
 src/clm/clmd/clms_mds.c  |  15 +-
 src/clm/clmd/clms_util.c |  33 +
 src/clm/clmnd/main.c |  80 ++
 src/clm/common/clmsv_msg.h   |   8 +++
 11 files changed, 253 insertions(+), 9 deletions(-)
 create mode 100644 scripts/clm-scripts/osafclm_stop

diff --git a/Makefile.am b/Makefile.am
index a7548d2..3fb6b50 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -78,6 +78,7 @@ pkgconfigdir = $(libdir)/pkgconfig
 pkgimmxmldir = $(pkgdatadir)/immxml
 pkgimmxml_svcdir = $(pkgimmxmldir)/services
 pkgclcclidir = $(pkglibdir)/clc-cli
+pkgclmscriptsdir = $(pkglibdir)/clm-scripts
 docdir = $(datadir)/doc/$(PACKAGE_NAME)-$(PACKAGE_VERSION)
 javadir = $(datadir)/java
 javadocdir = $(datadir)/javadoc
@@ -118,6 +119,7 @@ lib_libopensaf_core_la_SOURCES =
 nodist_java_DATA =
 nodist_osaf_execbin_SCRIPTS =
 nodist_pkgclccli_SCRIPTS =
+nodist_pkgclmscripts_SCRIPTS =
 nodist_pkgsysconf_DATA =
 noinst_HEADERS =
 noinst_LTLIBRARIES =
@@ -155,7 +157,8 @@ dist_osaf_execbin_SCRIPTS += \
$(top_srcdir)/scripts/opensaf_reboot \
$(top_srcdir)/scripts/opensaf_sc_active \
$(top_srcdir)/scripts/opensaf_scale_out \
-   $(top_srcdir)/scripts/plm_scale_out
+   $(top_srcdir)/scripts/plm_scale_out \
+   $(top_srcdir)/scripts/clm-scripts/osafclm_stop
 
 include $(top_srcdir)/src/ais/Makefile.am
 include $(top_srcdir)/src/base/Makefile.am
@@ -239,6 +242,7 @@ src/osaf/configmake.h: Makefile
echo '#define PKGIMMXMLDIR "$(pkgimmxmldir)"'; \
echo '#define PKGIMMXMLSVCDIR "$(pkgimmxml_svcdir)"'; \
echo '#define PKGCLCCLIDIR "$(pkgclcclidir)"'; \
+   echo '#define PKGCLMSCRIPTDIR "$(pkgclmscriptsdir)"'; \
echo '#define JAVADIR "$(javadir)"'; \
echo '#define JAVADOCDIR "$(javadocdir)"'; \
echo '#define LSBINITDIR "$(lsbinitdir)"'; \
@@ -325,12 +329,14 @@ install-data-hook: set-default-node-config
@for i in $$(grep -lr -e 'xxLIBDIRxx' -e 'xxLOGDIRxx' -e 
'xxCLCCLIDIRxx' $(DESTDIR)$(pkgimmxml_svcdir)/*.xml) ; do \
sed -i 's|xxLIBDIRxx|$(pkglibdir)|g' "$$i"; \
sed -i 's|xxCLCCLIDIRxx|$(pkgclcclidir)|g' "$$i"; \
+   sed -i 's|xxCLMSCRIPTDIRxx|$(pkgclmscriptsdir)|g' "$$i"; \
sed -i 's|xxLOGDIRxx|$(pkglogdir)|g' "$$i"; \
done
@for i in $$(grep -lr -e 'xxBINDIRxx' -e 'xxLIBDIRxx' -e 
'xxCLCCLIDIRxx' $(DESTDIR)$(pkgsysconfdir)/*) ; do \
sed --follow-symlinks -i 's|xxBINDIRxx|$(bindir)|g' "$$i"; \
sed --follow-symlinks -i 's|xxLIBDIRxx|$(pkglibdir)|g' "$$i"; \
sed --follow-symlinks -i 's|xxCLCCLIDIRxx|$(pkgclcclidir)|g' 
"$$i"; \
+   sed --follow-symlinks -i 
's|xxCLMSCRIPTDIRxx|$(pkgclmscriptsdir)|g' "$$i"; \
done
hostname -s > $(DESTDIR)$(pkgsysconfdir)/node_name
 if !ENABLE_AIS_PLM
diff --git a/opensaf.spec.in b/opensaf.spec.in
index d03f69e..f6f6625 100644
--- a/opensaf.spec.in
+++ b/opensaf.spec.in
@@ -34,6 +34,7 @@
 %define _initddir @initscriptdir@
 %define _pkgdatadir %{_datadir}/%{name}
 %define _pkgclcclidir %{_pkglibdir}/clc-cli
+#define _pkgclmscriptsdir %{_pkglibdir}/clm-scripts
 %if %is_immxml
 %define _pkgimmxmldir %{_datadir}/%{name}/immxml
 %define _pkgimmxml_svcdir %{_datadir}/%{name}/immxml/services
@@ -1070,6 +1071,7 @@ fi
 %defattr(-,root,root)
 %dir %{_pkgclcclidir}
 %dir %{_pkglibdir}
+%dir %{_pkgclmscriptsdir}
 %config(noreplace) %{_pkgsysconfdir}/clmna.conf
 %{_pkglibdir}/osafclmna
 %{_pkgclcclidir}/osaf-clmna
diff --git a/scripts/clm-scripts/osafclm_stop b/scripts/clm-scripts/osafclm_stop
new file mode 100644
index 000..840048b
--- /dev/null
+++ 

[devel] [PATCH 0/1] Review Request for clm: add new admin operations [#2649]

2017-10-23 Thread Zoran Milinkovic
Summary: clm: add new admin operations [#2649]
Review request for Ticket(s): 2649
Peer Reviewer(s): Hans, Anders, Ravi
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2649
Base revision: 308272ff1ce831e6295b744f7f903334ad485052
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision 139140322c7fb0674763fcc3ab802e9aeb608794
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Mon, 23 Oct 2017 16:29:44 +0200

clm: add new admin operations [#2649]

Add two new admin operations to CLM.
1. Node reboot will use the same openation id as cluster reboot, but the DN 
will contain CLM node

   Example for rebooting SC2:
 immadm -o 4 safNode=SC-2,safCluster=myClmCluster

2. Execute action on remote nodei(s) with operation id 5.
   Action is a script stored in /usr/lib/opensaf/clm-scripts directory started 
with prefix "osafclm_"
   The action name needs to be provided by saClmAction parameter, which is type 
of SaStringT.
   If the targeted DN is CLM node, the action will be done on the node.
   If the targeted DN is CLM cluster DN, the action will be done on all nodes 
in the cluster.

   Example for executing clm-scripts/osafclm_stop script on SC-2:
 immadm -o 5 -p saClmAction:SA_STRING_T:stop 
safNode=SC-2,safCluster=myClmCluster

   Example for executing clm-scripts/osafclm_stop script on all nodes:
 immadm -o 5 -p saClmAction:SA_STRING_T:stop safCluster=myClmCluster



Added Files:

 scripts/clm-scripts/osafclm_stop


Complete diffstat:
--
 Makefile.am  |   8 ++-
 opensaf.spec.in  |   2 +
 scripts/clm-scripts/osafclm_stop |   4 ++
 src/ais/include/saClm.h  |   3 +-
 src/clm/Makefile.am  |   3 ++
 src/clm/clmd/clms.h  |   2 +
 src/clm/clmd/clms_imm.c  | 104 ---
 src/clm/clmd/clms_mds.c  |  15 +-
 src/clm/clmd/clms_util.c |  33 +
 src/clm/clmnd/main.c |  80 ++
 src/clm/common/clmsv_msg.h   |   8 +++
 11 files changed, 253 insertions(+), 9 deletions(-)


Testing Commands:
-
Test examples from the description


Testing, Expected Results:
--
Examples from the description should work


Conditions of Submission:
-
Ack from Hans, Anders and Ravi


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 indicati

Re: [devel] [PATCH 1/1] amf: immxml-configure utility (tool) is failing with UTF-8 encoding [#2632]

2017-10-18 Thread Zoran Milinkovic
Hi Vijay,

Please fix indentation before you push the patch.
Ack from me.

Anders Bjornerstedt is not reviewing patches (ack or nack), but participates 
with giving comments in OpenSAF and IMM.

Thanks,
Zoran

-Original Message-
From: Vijay Roy [mailto:vijay@oracle.com] 
Sent: den 18 oktober 2017 12:11
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Vijay Roy <vijay@oracle.com>
Subject: [PATCH 1/1] amf: immxml-configure utility (tool) is failing with UTF-8 
encoding [#2632]

The fix is to support UTF-8 unicode validatoin for both UPPER_CASE (UTF-8) and 
lower_case (utf-8)
---
 src/imm/tools/immxml-merge | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/imm/tools/immxml-merge b/src/imm/tools/immxml-merge index 
8c17a4d..4c8d18d 100755
--- a/src/imm/tools/immxml-merge
+++ b/src/imm/tools/immxml-merge
@@ -318,7 +318,8 @@ class MergedImmDocument(BaseImmDocument):
 
 ## FIX for minidom problem with lost encoding info in saved xml 
document
 trace("encoding in first source xml document:%s", 
self.firstSourceDoc.encoding)
-if self.firstSourceDoc.encoding == "utf-8":
+   if self.firstSourceDoc.encoding is not None and \
+   self.firstSourceDoc.encoding.lower() == "utf-8":
 xml_as_string = self.document.toxml("utf-8")
 #xml_as_string = self.document.toprettyxml("", "", "utf-8")
 else:
--
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


Re: [devel] [PATCH 1/1] base: double start failed [#2622]

2017-10-17 Thread Zoran Milinkovic
Hi Rafael,

Reviewed the patch, but didn't test.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Rafael Odzakow 
Sent: den 16 oktober 2017 13:53
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Rafael Odzakow 
<rafael.odza...@ericsson.com>
Subject: [PATCH 1/1] base: double start failed [#2622]

Moving the setup_env caused ubuntu 14.04 systems to fail as they dont have the 
/var/lock/subsys directory by default.
---
 src/nid/opensafd.in | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/nid/opensafd.in b/src/nid/opensafd.in index d7035f5..ed7818f 
100644
--- a/src/nid/opensafd.in
+++ b/src/nid/opensafd.in
@@ -97,8 +97,6 @@ setup_env() {
getent passwd $OPENSAF_USER > /dev/null && chown 
$OPENSAF_USER $directory
fi
done
-   rm -f $pkgpiddir/*
-   rm -f $pkglogdir/nid.log
 }
 
 clean_shm() {
@@ -235,6 +233,8 @@ mutex_remove() {
 }
 
 start() {
+   setup_env
+
if ! mutex_create; then
return 1
fi
@@ -249,11 +249,11 @@ start() {
return $RETVAL
fi
 
+   rm -f $pkgpiddir/*
+   rm -f $pkglogdir/nid.log
 
[ -x $daemon ] || exit 5
 
-   setup_env
-
check_transport
 
logger -t $osafprog "Starting OpenSAF Services($osafversion - 
$osafcshash) (Using $MDS_TRANSPORT)"
--
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] base: double start failed [#2622]

2017-10-10 Thread Zoran Milinkovic
Hi,

Reviewed and tested the patch.
Ack from me with minor comment.

When OpenSAF is started the second time, it exits with "*". It would be good to 
write some text why OpenSAF didn't succeed to start, as it was a case with 
Hans's patch earlier.

Thanks,
Zoran

-Original Message-
From: Rafael Odzakow 
Sent: den 10 oktober 2017 14:08
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hans Nordebäck 
<hans.nordeb...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Rafael Odzakow 
<rafael.odza...@ericsson.com>
Subject: [PATCH 1/1] base: double start failed [#2622]

Previously named function "check_env" overwrites pid file. Move it to after 
running pidofproc for amfnd pid.
---
 src/nid/opensafd.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/nid/opensafd.in b/src/nid/opensafd.in index effe87d..d7035f5 
100644
--- a/src/nid/opensafd.in
+++ b/src/nid/opensafd.in
@@ -235,8 +235,6 @@ mutex_remove() {
 }
 
 start() {
-   setup_env
-
if ! mutex_create; then
return 1
fi
@@ -254,6 +252,8 @@ start() {
 
[ -x $daemon ] || exit 5
 
+   setup_env
+
check_transport
 
logger -t $osafprog "Starting OpenSAF Services($osafversion - 
$osafcshash) (Using $MDS_TRANSPORT)"
--
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] imm: Don't call exit() in IMM library [#2604]

2017-10-02 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 2 oktober 2017 08:47
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Don't call exit() in IMM library [#2604]

When PBE loses connection with IMMND, we don't call exit() in IMM library.
Instead, we mark the handle as exposed and then PBE will exit when it fails to 
call saImmOmDispatch.
---
 src/imm/agent/imma_db.cc | 11 +--
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/imm/agent/imma_db.cc b/src/imm/agent/imma_db.cc index 
cc771f7..d0e3682 100644
--- a/src/imm/agent/imma_db.cc
+++ b/src/imm/agent/imma_db.cc
@@ -685,11 +685,6 @@ void imma_mark_clients_stale(IMMA_CB *cb, bool 
mark_exposed) {
 temp_hdl = clnode->handle;
 temp_ptr = _hdl;
 
-if (clnode->isPbe) {
-  LOG_WA("PBE lost contact with parent IMMND - Exiting");
-  exit(1);
-}
-
 /* Process OM side CCBs */
 while ((ccb_node = (IMMA_CCB_NODE *)ncs_patricia_tree_getnext(
 >ccb_tree, (uint8_t *)ccb_temp_ptr))) { @@ -728,7 +723,11 
@@ void imma_mark_clients_stale(IMMA_CB *cb, bool mark_exposed) {
   continue;
 } /* No need to stale dispatched on this
  handle when already exposed. */
-if (mark_exposed) {
+if (clnode->isPbe) {
+  /* saImmOmDispatch will return ERR_BAD_HANDLE and PBE will exit */
+  LOG_WA("PBE lost contact with parent IMMND - marking handle as exposed");
+  clnode->exposed = true;
+} else if (mark_exposed) {
   clnode->exposed = true;
   LOG_WA("marking handle as exposed");
 } else if (clnode->isImmA2x12 && clnode->clmExposed) {
--
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] imm: Update admo id after resurrecting [#2591]

2017-09-26 Thread Zoran Milinkovic
Hi Hung,

Good catch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 26 september 2017 05:04
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Update admo id after resurrecting [#2591]

Update admo id after resurrecting.
---
 src/imm/agent/imma_om_api.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/imm/agent/imma_om_api.cc b/src/imm/agent/imma_om_api.cc
index 7da8a14..7155799 100644
--- a/src/imm/agent/imma_om_api.cc
+++ b/src/imm/agent/imma_om_api.cc
@@ -3917,8 +3917,6 @@ static SaAisErrorT admin_op_invoke_common(
   }
 
   immHandle = ao_node->mImmHandle;
-  adminOwnerId = ao_node->mAdminOwnerId;
-  ao_node = NULL;
 
   /* Look up client node also, to verify that the client handle
  is still active. */
@@ -3970,6 +3968,9 @@ static SaAisErrorT admin_op_invoke_common(
 TRACE_1("Reactive resurrect of handle %llx succeeded", immHandle);
   }
 
+  adminOwnerId = ao_node->mAdminOwnerId;
+  ao_node = NULL;
+
   if (isA2bCall && !(cl_node->isImmA2b)) {
 rc = SA_AIS_ERR_VERSION;
 TRACE_2(
-- 
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] imm: Don't allow setting new admo name when object is in a critical CCB [#2576]

2017-09-15 Thread Zoran Milinkovic
Hi Hung,

Reviewed the code.
Ack from me with a minor comment.

The comment in the code "// Note: interference only possible fore release." is 
not valid anymore since now both release and set are handled in "if (!doIt && 
ccbIdOfObj)"
You can only remove the line when you push the code.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 14 september 2017 06:42
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Don't allow setting new admo name when object is in a 
critical CCB [#2576]

When object is in a critical CCB and has no admo,
ERR_TRY_AGAIN will be returned if setting a new admo name to the object.

If setting a different admo name, ERR_EXIST will be returned as stated in IMM 
specification.
---
 src/imm/immnd/ImmModel.cc | 10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc
index 2a53ed4..275883b 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -5164,7 +5164,7 @@ SaAisErrorT ImmModel::adminOwnerChange(const struct 
immsv_a2nd_admown_set* req,
   CcbVector::iterator i2;
   ObjectInfo* objectInfo = i1->second;
   ccbIdOfObj = objectInfo->mCcbId;
-  if (!doIt && ccbIdOfObj && release) {
+  if (!doIt && ccbIdOfObj) {
 // check for ccb interference
 // Note: interference only possible fore release.
 // For set the adminowner is either same == noop;
@@ -5177,7 +5177,13 @@ SaAisErrorT ImmModel::adminOwnerChange(const struct 
immsv_a2nd_admown_set* req,
   if (!release && (adm->mAdminOwnerName == oldOwner)) {
 TRACE("Idempotent adminOwner set for %s on %s",
   oldOwner.c_str(), objectName.c_str());
-  } else {
+  } else if (!release && oldOwner.empty()
+  && (*i2)->mState == IMM_CCB_CRITICAL) {
+TRACE_7("ERR_TRY_AGAIN: Object '%s' is in a critical CCB (%d)",
+objectName.c_str(), (*i2)->mId);
+TRACE_LEAVE();
+return SA_AIS_ERR_TRY_AGAIN;
+  } else if (release) {
 LOG_IN("ERR_BUSY: ccb id %u active on object %s", ccbIdOfObj,
objectName.c_str());
 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 imm: remove disconnected appliers [#2579]

2017-09-11 Thread Zoran Milinkovic
Summary: imm: remove disconnected appliers [#2579]
Review request for Ticket(s): 2579
Peer Reviewer(s): Hung
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2579
Base revision: 10a83558372bbeae8b2d09e0fefd55cbc11dbd5d
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

NOTE: Patch(es) contain lines longer than 80 characers

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

revision b843838c0f947dedc53410729d4fb9c600501000
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Mon, 11 Sep 2017 17:46:23 +0200

imm: remove disconnected appliers [#2579]

When an applier is disconnected, it will be removed from the system after time 
period set in minApplierTimeout attribute in IMM object.
If the time is set to 0, it will work as it works today, and it will never be 
removed from the system.

The time set in minApplierTimeout attribute guarantees that the applier will be 
"alive" for at least the time set in the attribute.
When this period expires, with the next clean the basement call, the applier 
will be removed.

The time set in minApplierTimeout attribute is in seconds.

To enable this feature, protocol51710 must be enabled and minApplierTimeout 
attribute value must be great than 0.



Added Files:

 samples/immsv/OpensafImm_Upgrade_5.17.10.xml


Complete diffstat:
--
 samples/immsv/OpensafImm_Upgrade_5.17.10.xml | 120 +
 src/imm/common/immsv_api.h   |   2 +
 src/imm/common/immsv_evt.c   | 118 
 src/imm/common/immsv_evt.h   |  14 ++
 src/imm/immd/immd_evt.c  |  69 ++
 src/imm/immloadd/imm_loader.cc   |  12 +-
 src/imm/immnd/ImmModel.cc| 193 ++-
 src/imm/immnd/ImmModel.h |   6 +-
 src/imm/immnd/immnd_evt.c|  43 ++
 src/imm/immnd/immnd_init.h   |   5 +-
 src/imm/immnd/immnd_proc.c   |  41 +-
 11 files changed, 613 insertions(+), 10 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Disconnected appliers should be removed from the system after time period set 
in minApplierTimeout


Conditions of Submission:
-
Ack from Hung


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 we

[devel] [PATCH 1/1] imm: remove disconnected appliers [#2579]

2017-09-11 Thread Zoran Milinkovic
When an applier is disconnected, it will be removed from the system after time 
period set in minApplierTimeout attribute in IMM object.
If the time is set to 0, it will work as it works today, and it will never be 
removed from the system.

The time set in minApplierTimeout attribute guarantees that the applier will be 
"alive" for at least the time set in the attribute.
When this period expires, with the next clean the basement call, the applier 
will be removed.

The time set in minApplierTimeout attribute is in seconds.

To enable this feature, protocol51710 must be enabled and minApplierTimeout 
attribute value must be great than 0.
---
 samples/immsv/OpensafImm_Upgrade_5.17.10.xml | 120 +
 src/imm/common/immsv_api.h   |   2 +
 src/imm/common/immsv_evt.c   | 118 
 src/imm/common/immsv_evt.h   |  14 ++
 src/imm/immd/immd_evt.c  |  69 ++
 src/imm/immloadd/imm_loader.cc   |  12 +-
 src/imm/immnd/ImmModel.cc| 193 ++-
 src/imm/immnd/ImmModel.h |   6 +-
 src/imm/immnd/immnd_evt.c|  43 ++
 src/imm/immnd/immnd_init.h   |   5 +-
 src/imm/immnd/immnd_proc.c   |  41 +-
 11 files changed, 613 insertions(+), 10 deletions(-)
 create mode 100644 samples/immsv/OpensafImm_Upgrade_5.17.10.xml

diff --git a/samples/immsv/OpensafImm_Upgrade_5.17.10.xml 
b/samples/immsv/OpensafImm_Upgrade_5.17.10.xml
new file mode 100644
index 000..fb70880
--- /dev/null
+++ b/samples/immsv/OpensafImm_Upgrade_5.17.10.xml
@@ -0,0 +1,120 @@
+
+http://www.w3.org/2001/XMLSchema-instance; 
xsi:noNamespaceSchemaLocation="SAI-AIS-IMM-XSD-A.02.13.xsd" 
xmlns:xs="http://www.w3.org/2001/XMLSchema; 
xmlns:imm="http://www.saforum.org/IMMSchema;>
+  
+SA_CONFIG
+
+  opensafImm
+  SA_NAME_T
+  SA_CONFIG
+  SA_INITIALIZED
+
+
+  maxClasses
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  1000
+
+
+  maxImplementers
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  3000
+
+
+  maxAdminowners
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  2000
+
+
+  maxCcbs
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  1
+
+
+  scAbsenceAllowed
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_PERSISTENT
+  SA_CACHED
+  0
+
+
+  accessControlMode
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  authorizedGroup
+  SA_STRING_T
+  SA_CONFIG
+  SA_WRITABLE
+
+
+  longDnsAllowed
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  opensafImmSyncBatchSize
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  65223
+
+
+  opensafImmNostdFlags
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_CACHED
+  0
+
+
+  opensafImmEpoch
+  SA_UINT32_T
+  SA_RUNTIME
+  SA_PERSISTENT
+  SA_CACHED
+
+
+  opensafImmClassNames
+  SA_STRING_T
+  SA_RUNTIME
+  SA_MULTI_VALUE
+  SA_PERSISTENT
+  SA_CACHED
+
+
+  minApplierTimeout
+  SA_UINT32_T
+  SA_CONFIG
+  SA_WRITABLE
+  0
+
+
+  SaImmAttrImplementerName
+  SA_STRING_T
+  SA_CONFIG
+
+
+  SaImmAttrClassName
+  SA_STRING_T
+  SA_CONFIG
+  OpensafImm
+
+
+  SaImmAttrAdminOwnerName
+  SA_STRING_T
+  SA_CONFIG
+
+  
+
diff --git a/src/imm/common/immsv_api.h b/src/imm/common/immsv_api.h
index cb43ec6..32fc573 100644
--- a/src/imm/common/immsv_api.h
+++ b/src/imm/common/immsv_api.h
@@ -69,6 +69,7 @@ extern "C" {
 #define OPENSAF_IMM_MAX_IMPLEMENTERS "maxImplementers"
 #define OPENSAF_IMM_MAX_ADMINOWNERS "maxAdminowners"
 #define OPENSAF_IMM_MAX_CCBS "maxCcbs"
+#define OPENSAF_IMM_MIN_APPLIER_TIMEOUT "minApplierTimeout"
 
 typedef enum {
   ACCESS_CONTROL_DISABLED = 0,
@@ -149,6 +150,7 @@ typedef enum {
 #define OPENSAF_IMM_FLAG_PRT47_ALLOW 0x0040
 #define OPENSAF_IMM_FLAG_PRT50_ALLOW 0x0080
 #define OPENSAF_IMM_FLAG_PRT51_ALLOW 0x0100
+#define OPENSAF_IMM_FLAG_PRT51710_ALLOW 0x0200
 
 #define OPENSAF_IMM_SERVICE_NAME "safImmService"
 
diff --git a/src/imm/common/immsv_evt.c b/src/imm/common/immsv_evt.c
index 8871c14..88c5101 100644
--- a/src/imm/common/immsv_evt.c
+++ b/src/imm/common/immsv_evt.c
@@ -66,6 +66,7 @@ static const char *immd_evt_names[] = {"undefined",
   "IMMD_EVT_ND2D_LOADING_COMPLETED",
   "IMMD_EVT_ND2D_2PBE_PRELOAD",
   "IMMD_EVT_ND2D_IMPLSET_REQ_2",
+  "IMMD_EVT_ND2D_IMPLDELETE",
   "undefined (high)"};
 
 static const char *immsv_get_immd_evt_name(unsigned int id)
@@ -185,6 

Re: [devel] [PATCH 1/1] imm: Validate input invocation for saImmOiAdminOperationResult [#2571]

2017-09-07 Thread Zoran Milinkovic
Hi Hung,

Reviewed the code.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 6 september 2017 12:55
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Validate input invocation for 
saImmOiAdminOperationResult [#2571]

Add new set to IMMA_CLIENT_NODE to store the invocations.
The invocation is added to the set when dispatching the callback and is removed 
from the set in saImmOiAdminOperationResult.
---
 src/imm/agent/imma_cb.h  |  5 +
 src/imm/agent/imma_db.cc |  2 +-
 src/imm/agent/imma_oi_api.cc | 14 --  src/imm/agent/imma_om_api.cc 
|  6 +++---
 src/imm/agent/imma_proc.cc   |  1 +
 5 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/src/imm/agent/imma_cb.h b/src/imm/agent/imma_cb.h index 
c478990..454ad11 100644
--- a/src/imm/agent/imma_cb.h
+++ b/src/imm/agent/imma_cb.h
@@ -19,6 +19,8 @@
 #ifndef IMM_AGENT_IMMA_CB_H_
 #define IMM_AGENT_IMMA_CB_H_
 
+#include 
+
 /* Node to store Ccb info for OI client */  struct imma_callback_info;
 
@@ -95,6 +97,9 @@ typedef struct imma_client_node {
   SaTimeT
   oiTimeout; /* Timeout for OI callback. If the value is 0, the default
 timeout (6s) will be used */
+
+  /* Current callback invocations */
+  std::set callbackInvocationSet;
 } IMMA_CLIENT_NODE;
 
 /* Node to store adminOwner info */
diff --git a/src/imm/agent/imma_db.cc b/src/imm/agent/imma_db.cc index 
1ed590e..cc771f7 100644
--- a/src/imm/agent/imma_db.cc
+++ b/src/imm/agent/imma_db.cc
@@ -113,7 +113,7 @@ uint32_t imma_client_node_delete(IMMA_CB *cb, 
IMMA_CLIENT_NODE *cl_node) {
 imma_oi_ccb_record_delete(cl_node, cl_node->activeOiCcbs->ccbId);
   }
 
-  free(cl_node);
+  delete cl_node;
 
   return rc;
 }
diff --git a/src/imm/agent/imma_oi_api.cc b/src/imm/agent/imma_oi_api.cc index 
3451c85..28cea8a 100644
--- a/src/imm/agent/imma_oi_api.cc
+++ b/src/imm/agent/imma_oi_api.cc
@@ -152,7 +152,7 @@ SaAisErrorT initialize_common(SaImmOiHandleT *immOiHandle,
   *immOiHandle = 0;
 
   /* Alloc the client info data structure & put it in the Pat tree */
-  cl_node = (IMMA_CLIENT_NODE *)calloc(1, sizeof(IMMA_CLIENT_NODE));
+  cl_node = new IMMA_CLIENT_NODE{};
   if (cl_node == NULL) {
 TRACE_2("ERR_NO_MEMORY: IMMA_CLIENT_NODE alloc failed");
 rc = SA_AIS_ERR_NO_MEMORY;
@@ -384,7 +384,7 @@ version_fail:
   }
 
 lock_fail:
-  if (rc != SA_AIS_OK) free(cl_node);
+  if (rc != SA_AIS_OK) delete cl_node;
 
 cnode_alloc_fail:
 
@@ -1004,6 +1004,16 @@ static SaAisErrorT admin_op_result_common(
 goto stale_handle;
   }
 
+  if (cl_node->callbackInvocationSet.find(invocation)
+  == cl_node->callbackInvocationSet.end()) {
+LOG_WA(
+"ERR_INVALID_PARAM: Illegal SaInvocationT value provided in 
saImmOiAdminOperationResult");
+rc = SA_AIS_ERR_INVALID_PARAM;
+goto stale_handle;
+  } else {
+cl_node->callbackInvocationSet.erase(invocation);
+  }
+
   /* populate the structure */
   memset(_evt, 0, sizeof(IMMSV_EVT));
   adminOpRslt_evt.type = IMMSV_EVT_TYPE_IMMND; diff --git 
a/src/imm/agent/imma_om_api.cc b/src/imm/agent/imma_om_api.cc index 
51822f0..7da8a14 100644
--- a/src/imm/agent/imma_om_api.cc
+++ b/src/imm/agent/imma_om_api.cc
@@ -126,7 +126,7 @@ SaAisErrorT saImmOmInitialize_o2(SaImmHandleT *immHandle,
   }
 
   /* Alloc the client info data structure */
-  cl_node = (IMMA_CLIENT_NODE *)calloc(1, sizeof(IMMA_CLIENT_NODE));
+  cl_node = new IMMA_CLIENT_NODE{};
 
   if (cl_node == NULL) {
 TRACE_4("ERR_NO_MEMORY: IMMA_CLIENT_NODE alloc failed"); @@ -186,7 +186,7 
@@ SaAisErrorT saImmOmInitialize(SaImmHandleT *immHandle,
   }
 
   /* Alloc the client info data structure */
-  cl_node = (IMMA_CLIENT_NODE *)calloc(1, sizeof(IMMA_CLIENT_NODE));
+  cl_node = new IMMA_CLIENT_NODE{};
 
   if (cl_node == NULL) {
 TRACE_4("ERR_NO_MEMORY: IMMA_CLIENT_NODE alloc failed"); @@ -467,7 +467,7 
@@ end:
   rc = SA_AIS_ERR_LIBRARY;
 }
 
-free(cl_node);
+delete cl_node;
   }
 
   TRACE_LEAVE();
diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc index 
cca734f..886b50c 100644
--- a/src/imm/agent/imma_proc.cc
+++ b/src/imm/agent/imma_proc.cc
@@ -2221,6 +2221,7 @@ static bool imma_process_callback_info(IMMA_CB *cb, 
IMMA_CLIENT_NODE *cl_node,
   }
 }
   }
+  cl_node->callbackInvocationSet.insert(callback->invocation);
   if (cl_node->o.iCallbk.saImmOiAdminOperationCallback &&
   isExtendedNameValid && !isAttrExtendedName) {
 if (cl_node->isImmA2fCbk) {
--
2.7.4


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.lin

Re: [devel] [PATCH 1/1] imm: Regenerate PBE on SQLITE_CORRUPT and SQLITE_MISMATCH [#2573]

2017-09-06 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 6 september 2017 13:42
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Regenerate PBE on SQLITE_CORRUPT and SQLITE_MISMATCH 
[#2573]

Regenerate PBE on SQLITE_CORRUPT and SQLITE_MISMATCH.
---
 src/imm/common/immpbe_dump.cc | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc 
index 3d7c57e..11af674 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -415,7 +415,8 @@ static void valuesToPBE(const SaImmAttrValuesT_2 *p, 
SaImmAttrFlagsT attrFlags,
 if (rc != SQLITE_DONE) {
   LOG_ER("SQL statement ('%s') failed with error code: %d\n",
  preparedSql[sqlIndex], rc);
-  if (rc == SQLITE_CONSTRAINT) {
+  if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+  || rc == SQLITE_MISMATCH) {
 badfile = true;
   }
   goto bailout;
@@ -2405,7 +2406,8 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
 LOG_ER("SQL statement('%s') failed with error code: %d",
preparedSql[SQL_INS_OBJECTS], rc);
-if (rc == SQLITE_CONSTRAINT) {
+if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+|| rc == SQLITE_MISMATCH) {
   badfile = true;
 }
 goto bailout;
@@ -2475,7 +2477,8 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
 LOG_ER("SQL object statement for table '%s' failed with error code: %d\n",
classNameString.c_str(), rc);
-if(rc == SQLITE_CONSTRAINT) {
+if (rc == SQLITE_CONSTRAINT || rc == SQLITE_CORRUPT
+|| rc == SQLITE_MISMATCH) {
   badfile = true;
 }
 goto bailout;
--
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] smf: fix to avoid core dump during smf upgrade while imm sync [#2550]

2017-08-22 Thread Zoran Milinkovic
Hi,

Loading and sync should be done in one minute.

BR,
Zoran

-Original Message-
From: Vijay Roy [mailto:vijay@oracle.com] 
Sent: den 22 augusti 2017 14:20
To: Lennart Lund <lennart.l...@ericsson.com>; Rafael Odzakow 
<rafael.odza...@ericsson.com>; Reddy Neelakanta Reddy Peddavandla 
<reddy.neelaka...@oracle.com>; Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] smf: fix to avoid core dump during smf upgrade while 
imm sync [#2550]

Hi Lennart,

Thanks for you inputs. I completely agree with you analysis on TRY AGAIN & time 
out in below case. 
Will wait to hear from Zoron and will move accordingly on "resource abort" & 
"TRY AGAIN".

Regards
Vijay

-Original Message-
From: Lennart Lund [mailto:lennart.l...@ericsson.com]
Sent: Monday, August 21, 2017 7:02 PM
To: Vijay Roy <vijay@oracle.com>; Rafael Odzakow 
<rafael.odza...@ericsson.com>; Reddy Neelakanta Reddy Peddavandla 
<reddy.neelaka...@oracle.com>; Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Lennart Lund 
<lennart.l...@ericsson.com>
Subject: RE: [PATCH 1/1] smf: fix to avoid core dump during smf upgrade while 
imm sync [#2550]

Hi Vijay

When I look at the ticket I can see that the CCB is aborted (because IMM  
starts a synch). The actual return code from IMM is then 
SA_AIS_ERR_FAILED_OPERATION but in the case the failed operation is caused by a 
"resource abort" the return code is changed by the doImmOperations() method to 
SA_AIS_TRY_AGAIN. This means that if TRY AGAIN it is either a "resource abort" 
or that the TRY AGAIN loop for the actual IMM API call has timed out. The 
timeout for TRY AGAIN is very long (10 min, see settings in smf_main.cc) so it 
is possible to be stuck in the new loop for 20 min if a timeout is the cause.
In the loop immUtil.doImmOperations() is immediately called again if TRY AGAIN 
is returned. This means that synchronization may still be ongoing. 
Synchronization may take some time and immUtil.doImmOperations() will fail 
again. I don't know how long to wait but I suspect I may take some time maybe 1 
min? Zoran can probably give a good answer.

Maybe immUtil.doImmOperations() should be refactored so that it is possible to 
distingue between "resource abort" and TRY AGAIN timeout and only handle some 
try again if "resource abort"? Or another thing to do could be to handle try 
again if "resource abort" within the doImmOperations() method?

Thanks
Lennart

> -Original Message-
> From: Vijay Roy [mailto:vijay@oracle.com]
> Sent: den 17 augusti 2017 14:05
> To: Rafael Odzakow <rafael.odza...@ericsson.com>; Lennart Lund 
> <lennart.l...@ericsson.com>; reddy.neelaka...@oracle.com
> Cc: opensaf-devel@lists.sourceforge.net; Vijay Roy 
> <vijay@oracle.com>
> Subject: [PATCH 1/1] smf: fix to avoid core dump during smf upgrade 
> while imm sync [#2550]
> 
> ---
>  src/smf/smfd/SmfUpgradeStep.cc | 31 +++--
> --
>  1 file changed, 27 insertions(+), 4 deletions(-)
> 
> diff --git a/src/smf/smfd/SmfUpgradeStep.cc 
> b/src/smf/smfd/SmfUpgradeStep.cc index 909fe12..ebf94ca 100644
> --- a/src/smf/smfd/SmfUpgradeStep.cc
> +++ b/src/smf/smfd/SmfUpgradeStep.cc
> @@ -890,11 +890,34 @@ bool
> SmfUpgradeStep::setMaintenanceState(SmfActivationUnit _units) {
>  }
>}
> 
> -  if ((result = immUtil.doImmOperations(operations)) != SA_AIS_OK) {
> +if ((result = immUtil.doImmOperations(operations)) != SA_AIS_OK) {
>  LOG_NO("Fails to set saAmfSUMaintenanceCampaign, rc=%s", 
> saf_error(result));
> -rc = false;
> -goto exit;
> -  }
> +
> +   // Fix for SF:2550
> +
> +const uint32_t MAX_NO_RETRIES = 2;
> +uint32_t retry_cnt = 0;
> +int ret = SA_AIS_OK;
> +while (++retry_cnt <= MAX_NO_RETRIES) {
> + ret = immUtil.doImmOperations(operations);
> +   if (ret != SA_AIS_OK && ret == SA_AIS_ERR_TRY_AGAIN) {
> +   /*
> +* TRY_AGAIN is returned only when ccb is aborted
> +*  with Resource abort in error string. Resource 
> abort in
> +*  error string is checked presently for modify 
> operation.
> +*/
> +   continue;
> +   }
> + }
> +
> +   if (ret != SA_AIS_OK){
> +   LOG_NO("SmfUpgradeStep::setMaintenanceState(), fails 
> + to set all
> saAmfSUMaintenanceCampaign attr");
> +rc = false;
> +goto exit;
> +   }
> +
> + }
> +   // Fix for SF:2550
> 
>  e

[devel] [PATCH 0/1] Review Request for imm: change log level from error to warning in PBE [#2559]

2017-08-17 Thread Zoran Milinkovic
Summary: imm: change log level from error to warning in PBE [#2559]
Review request for Ticket(s): 2559
Peer Reviewer(s): Hung, Mahesh
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2559
Base revision: e78203f0153360806c318e59b47845d438b3382e
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 7a9c27240d74b3d0c2df8733663687665ec6729d
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Thu, 17 Aug 2017 14:53:23 +0200

imm: change log level from error to warning in PBE [#2559]

In #2491, the log message if logged always with error log level.
If a cluster goes headless, this case is very likely to be happen
with ERR_TRY_AGAIN, but that's expected behavior when the cluster
goes headless.



Complete diffstat:
--
 src/imm/common/immpbe_dump.cc | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Check that the log message is logged with warning log level when the cluster 
goes headless.


Conditions of Submission:
-
Ack from Hung and Mahesh


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 from error to warning in PBE [#2559]

2017-08-17 Thread Zoran Milinkovic
In #2491, the log message if logged always with error log level.
If a cluster goes headless, this case is very likely to be happen
with ERR_TRY_AGAIN, but that's expected behavior when the cluster
goes headless.
---
 src/imm/common/immpbe_dump.cc | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
index 4c2b2ea..3d7c57e 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -1276,9 +1276,15 @@ static ClassInfo *verifyClassPBE(std::string 
classNameString,
   if (errorCode != SA_AIS_OK) {
 if (errorCode != SA_AIS_ERR_NOT_EXIST
 && errorCode != SA_AIS_ERR_INVALID_PARAM) {
-LOG_ER("Failed to get class description for class '%s' from imm "
-   "with error=%d, exiting",
-   classNameString.c_str(), errorCode);
+if(errorCode == SA_AIS_ERR_TRY_AGAIN) {
+LOG_WA("Failed to get class description for class '%s' from imm "
+   "with error=%d, exiting",
+   classNameString.c_str(), errorCode);
+} else {
+LOG_ER("Failed to get class description for class '%s' from imm "
+   "with error=%d, exiting",
+   classNameString.c_str(), errorCode);
+}
 exit(1);
 }
 TRACE_4(
-- 
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


Re: [devel] [PATCH 1/1] imm: fix immnd coredump due to initialized CLM handle [#2549]

2017-08-16 Thread Zoran Milinkovic
Hi Mahesh,

immnd_cb->clm_hdl should be cleared when CLM invalidates the handle. CLM handle 
should not be closed when the node goes headless.
immnd_cb->clm_hdl is set to 0 in main() function when CLM handle is invalidated 
and selected object closed. That's the last line in the patch where 
immnd_cb->clm_hdl is set to 0.

Thanks,
Zoran

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: den 16 augusti 2017 05:59
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: fix immnd coredump due to initialized CLM handle 
[#2549]

Hi Zoran ,

ACK , with following , not tested.

Please check that  the `immnd_cb->clm_hdl` cleared on Headless case.

-AVM


On 8/9/2017 5:14 PM, Zoran Milinkovic wrote:
> Initially CLM handle is set to 0. When CLM handle is initialized, it 
> can be initialized again only when saClmDispatch returns 
> SA_AIS_ERR_BAD_HANDLE.
> This will prevent coredumps with initialized CLM handle caused with 
> MDS UP message for AMF and CLM services.
> ---
>   src/imm/immnd/immnd_clm.c  | 7 +++
>   src/imm/immnd/immnd_main.c | 8 +---
>   2 files changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/src/imm/immnd/immnd_clm.c b/src/imm/immnd/immnd_clm.c 
> index 4019439..beae739 100644
> --- a/src/imm/immnd/immnd_clm.c
> +++ b/src/imm/immnd/immnd_clm.c
> @@ -199,6 +199,11 @@ void *immnd_clm_init_thread(void *cb)
>   {
>   TRACE_ENTER();
>   
> + if(immnd_cb->clm_hdl) {
> + TRACE("CLM handle has already been initialized.");
> + goto done;
> + }
> +
>   SaAisErrorT rc =
>   saClmInitialize_4(_cb->clm_hdl, _callbacks, );
>   while ((rc == SA_AIS_ERR_TRY_AGAIN) || (rc == SA_AIS_ERR_TIMEOUT) 
> || @@ -228,6 +233,8 @@ void *immnd_clm_init_thread(void *cb)
>   exit(EXIT_FAILURE);
>   }
>   TRACE("CLM Initialization SUCCESS..");
> +
> +done:
>   TRACE_LEAVE();
>   return NULL;
>   }
> diff --git a/src/imm/immnd/immnd_main.c b/src/imm/immnd/immnd_main.c 
> index bca8f80..0f8364d 100644
> --- a/src/imm/immnd/immnd_main.c
> +++ b/src/imm/immnd/immnd_main.c
> @@ -423,11 +423,12 @@ int main(int argc, char *argv[])
>   }
>   
>   if (fds[FD_CLM_INIT].revents & POLLIN) {
> - osafassert(!immnd_cb->clm_hdl);
> - TRACE("Initalize CLM ");
>   ncs_sel_obj_rmv_ind(_cb->clm_init_sel_obj,
>   true, true);
> - immnd_init_with_clm();
> + if(!immnd_cb->clm_hdl) {
> + TRACE("Initalize CLM ");
> + immnd_init_with_clm();
> + }
>   nfds = 5;
>   }
>   
> @@ -445,6 +446,7 @@ int main(int argc, char *argv[])
>   immnd_cb->clm_hdl);
>   immnd_clm_node_cleanup(
>   immnd_cb);
> + immnd_cb->clm_hdl = 0;
>   immnd_cb->clmSelectionObject =
>   -1;
>   immnd_init_with_clm();

--
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 imm: regenerate PBE in verifyClassPBE only if database is corrupted [#2491]

2017-08-14 Thread Zoran Milinkovic
Summary: imm: regenerate PBE in verifyClassPBE only if database is corrupted 
[#2491]
Review request for Ticket(s): 2491
Peer Reviewer(s): Hung, Mahesh
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2491
Base revision: 8a15fb881c238d4e3246d97d7e5201e5ae235af5
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 13fd2be582b9445bc8ea9ca20e281f0a3e39cd29
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Mon, 14 Aug 2017 14:30:53 +0200

imm: regenerate PBE in verifyClassPBE only if database is corrupted [#2491]

In verifyClassPBE(), the patch makes distinguish between IMM issue and database 
corruption.
For IMM issue, PBE will not be regenerated, while for database corruption, PBE 
will be regenerated.



Complete diffstat:
--
 src/imm/common/immpbe_dump.cc | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
See commit message


Conditions of Submission:
-
Ack from Hung and Mahesh


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: regenerate PBE in verifyClassPBE only if database is corrupted [#2491]

2017-08-14 Thread Zoran Milinkovic
In verifyClassPBE(), the patch makes distinguish between IMM issue and database 
corruption.
For IMM issue, PBE will not be regenerated, while for database corruption, PBE 
will be regenerated.
---
 src/imm/common/immpbe_dump.cc | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
index 100222f..4c2b2ea 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -1209,7 +1209,8 @@ bailout:
 }
 
 static ClassInfo *verifyClassPBE(std::string classNameString,
- SaImmHandleT immHandle, void *db_handle) {
+ SaImmHandleT immHandle,
+ void *db_handle, bool *badfile) {
   sqlite3 *dbHandle = (sqlite3 *)db_handle;
   int rc = 0;
   unsigned int class_id = 0;
@@ -1230,6 +1231,8 @@ static ClassInfo *verifyClassPBE(std::string 
classNameString,
 
   TRACE_ENTER();
 
+  *badfile = false;
+
   stmt = preparedStmt[SQL_SEL_CLASSES_NAME];
   if ((rc = sqlite3_bind_text(stmt, 1, classNameString.c_str(), -1, NULL)) !=
   SQLITE_OK) {
@@ -1271,10 +1274,17 @@ static ClassInfo *verifyClassPBE(std::string 
classNameString,
, );
 
   if (errorCode != SA_AIS_OK) {
+if (errorCode != SA_AIS_ERR_NOT_EXIST
+&& errorCode != SA_AIS_ERR_INVALID_PARAM) {
+LOG_ER("Failed to get class description for class '%s' from imm "
+   "with error=%d, exiting",
+   classNameString.c_str(), errorCode);
+exit(1);
+}
 TRACE_4(
 "Failed to get class description for class %s from imm with error=%d",
 classNameString.c_str(), errorCode);
-if (errorCode == SA_AIS_ERR_TRY_AGAIN) exit(1);
+*badfile = true;
 goto bailout;
   }
 
@@ -1290,6 +1300,7 @@ static ClassInfo *verifyClassPBE(std::string 
classNameString,
(sqlite3_stmt **)&(classInfo->sqlStmt))) != SQLITE_OK) {
 LOG_ER("Failed to prepare class insert statement. Error code: %d", rc);
 saImmOmClassDescriptionMemoryFree_2(immHandle, attrDefinitions);
+*badfile = true;
 goto bailout;
   }
 
@@ -2563,12 +2574,11 @@ int verifyPbeState(SaImmHandleT immHandle, ClassMap 
*classIdMap,
   }
 
   while (it != classNameList.end()) {
-ClassInfo *cl_info = verifyClassPBE((*it), immHandle, dbHandle);
+ClassInfo *cl_info = verifyClassPBE((*it), immHandle, dbHandle, );
 if (cl_info) {
   (*classIdMap)[(*it)] = cl_info;
   it++;
 } else {
-  badfile = true;
   goto bailout;
 }
   }
-- 
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 1/1] imm: fix immnd coredump due to initialized CLM handle [#2549]

2017-08-09 Thread Zoran Milinkovic
Initially CLM handle is set to 0. When CLM handle is initialized,
it can be initialized again only when saClmDispatch returns 
SA_AIS_ERR_BAD_HANDLE.
This will prevent coredumps with initialized CLM handle
caused with MDS UP message for AMF and CLM services.
---
 src/imm/immnd/immnd_clm.c  | 7 +++
 src/imm/immnd/immnd_main.c | 8 +---
 2 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/imm/immnd/immnd_clm.c b/src/imm/immnd/immnd_clm.c
index 4019439..beae739 100644
--- a/src/imm/immnd/immnd_clm.c
+++ b/src/imm/immnd/immnd_clm.c
@@ -199,6 +199,11 @@ void *immnd_clm_init_thread(void *cb)
 {
TRACE_ENTER();
 
+   if(immnd_cb->clm_hdl) {
+   TRACE("CLM handle has already been initialized.");
+   goto done;
+   }
+
SaAisErrorT rc =
saClmInitialize_4(_cb->clm_hdl, _callbacks, );
while ((rc == SA_AIS_ERR_TRY_AGAIN) || (rc == SA_AIS_ERR_TIMEOUT) ||
@@ -228,6 +233,8 @@ void *immnd_clm_init_thread(void *cb)
exit(EXIT_FAILURE);
}
TRACE("CLM Initialization SUCCESS..");
+
+done:
TRACE_LEAVE();
return NULL;
 }
diff --git a/src/imm/immnd/immnd_main.c b/src/imm/immnd/immnd_main.c
index bca8f80..0f8364d 100644
--- a/src/imm/immnd/immnd_main.c
+++ b/src/imm/immnd/immnd_main.c
@@ -423,11 +423,12 @@ int main(int argc, char *argv[])
}
 
if (fds[FD_CLM_INIT].revents & POLLIN) {
-   osafassert(!immnd_cb->clm_hdl);
-   TRACE("Initalize CLM ");
ncs_sel_obj_rmv_ind(_cb->clm_init_sel_obj,
true, true);
-   immnd_init_with_clm();
+   if(!immnd_cb->clm_hdl) {
+   TRACE("Initalize CLM ");
+   immnd_init_with_clm();
+   }
nfds = 5;
}
 
@@ -445,6 +446,7 @@ int main(int argc, char *argv[])
immnd_cb->clm_hdl);
immnd_clm_node_cleanup(
immnd_cb);
+   immnd_cb->clm_hdl = 0;
immnd_cb->clmSelectionObject =
-1;
immnd_init_with_clm();
-- 
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 imm: fix immnd coredump due to initialized CLM handle [#2549]

2017-08-09 Thread Zoran Milinkovic
Summary: imm: fix immnd coredump due to initialized CLM handle [#2549]
Review request for Ticket(s): 2549
Peer Reviewer(s): Hung, Mahesh
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2549
Base revision: 56f638bc7ac2f5baa8988e6500eb63160de75a2d
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 668d3ccc3bb5adff9c3891dcaadeafe9508486f8
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 9 Aug 2017 13:37:11 +0200

imm: fix immnd coredump due to initialized CLM handle [#2549]

Initially CLM handle is set to 0. When CLM handle is initialized,
it can be initialized again only when saClmDispatch returns 
SA_AIS_ERR_BAD_HANDLE.
This will prevent coredumps with initialized CLM handle
caused with MDS UP message for AMF and CLM services.



Complete diffstat:
--
 src/imm/immnd/immnd_clm.c  | 7 +++
 src/imm/immnd/immnd_main.c | 8 +---
 2 files changed, 12 insertions(+), 3 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
IMMND should not assert when AMF or CLM services come up again.


Conditions of Submission:
-
Ack from Hung and Mahesh.


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: include CLM in poll before CLM handle is initialized [#2544]

2017-08-07 Thread Zoran Milinkovic
CLM selection object is initially set to -1. Included CLM selection
object in poll will be ignored until CLM selection object is created
and set to fds[FD_CLM].
---
 src/imm/immnd/immnd_main.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/imm/immnd/immnd_main.c b/src/imm/immnd/immnd_main.c
index bca8f80..67759ff 100644
--- a/src/imm/immnd/immnd_main.c
+++ b/src/imm/immnd/immnd_main.c
@@ -303,8 +303,7 @@ int main(int argc, char *argv[])
int maxEvt = 100;
struct timespec start_time;
struct pollfd fds[5];
-   int term_fd, nfds = 4;
-   ;
+   int term_fd, nfds = 5;
 
daemonize(argc, argv);
 
@@ -428,7 +427,6 @@ int main(int argc, char *argv[])
ncs_sel_obj_rmv_ind(_cb->clm_init_sel_obj,
true, true);
immnd_init_with_clm();
-   nfds = 5;
}
 
if (fds[FD_CLM].revents & POLLIN) {
-- 
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 clm: handle ERR_BAD_HANDLE for saImmOmSearchInitialize [#2528]

2017-07-14 Thread Zoran Milinkovic
Summary: clm: handle ERR_BAD_HANDLE for saImmOmSearchInitialize [#2528]
Review request for Ticket(s): 2528
Peer Reviewer(s): Praveen, Anders
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2528
Base revision: 3be8e9adb4670607a93907a886b0cf301570d65a
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 9a66b4b04c12118721367b94327995462ae70282
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Fri, 14 Jul 2017 15:07:12 +0200

clm: handle ERR_BAD_HANDLE for saImmOmSearchInitialize [#2528]

CLM handles ERR_BAD_HANDLE for saImmOmSearchInitialize in 
clms_cluster_config_get.
As part of this patch, handling of IMM version is improved in the same function.



Complete diffstat:
--
 src/clm/clmd/clms_imm.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)


Testing Commands:
-


Testing, Expected Results:
--
clms_cluster_config_get should handle ERR_BAD_HANLDE in saImmOmSearchInitialize


Conditions of Submission:
-
Ack from Praveen and Anders


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] clm: handle ERR_BAD_HANDLE for saImmOmSearchInitialize [#2528]

2017-07-14 Thread Zoran Milinkovic
CLM handles ERR_BAD_HANDLE for saImmOmSearchInitialize in 
clms_cluster_config_get.
As part of this patch, handling of IMM version is improved in the same function.
---
 src/clm/clmd/clms_imm.c | 18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/src/clm/clmd/clms_imm.c b/src/clm/clmd/clms_imm.c
index 06a7df8..51429ec 100644
--- a/src/clm/clmd/clms_imm.c
+++ b/src/clm/clmd/clms_imm.c
@@ -432,10 +432,12 @@ SaAisErrorT clms_cluster_config_get(void)
SaNameT dn;
SaImmAttrValuesT_2 **attributes;
const char *className = "SaClmCluster";
+   SaVersionT version;
 
TRACE_ENTER();
 
-   (void)immutil_saImmOmInitialize(_om_hdl, NULL, );
+   version = immVersion;
+   (void)immutil_saImmOmInitialize(_om_hdl, NULL, );
 
searchParam.searchOneAttr.attrName = "SaImmAttrClassName";
searchParam.searchOneAttr.attrValueType = SA_IMM_ATTR_SASTRINGT;
@@ -446,6 +448,20 @@ SaAisErrorT clms_cluster_config_get(void)
SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR, ,
NULL, _hdl);
 
+   if (rc == SA_AIS_ERR_BAD_HANDLE) {
+   // Repeat one more search on ERR_BAD_HANDLE
+
+   // Close the open OM handle, and initialize a new one
+   (void)immutil_saImmOmFinalize(imm_om_hdl);
+   version = immVersion;
+   (void)immutil_saImmOmInitialize(_om_hdl, NULL, );
+
+   rc = immutil_saImmOmSearchInitialize_2(
+   imm_om_hdl, _cluster->name, SA_IMM_SUBTREE,
+   SA_IMM_SEARCH_ONE_ATTR | SA_IMM_SEARCH_GET_ALL_ATTR,
+   , NULL, _hdl);
+   }
+
if (rc != SA_AIS_OK) {
LOG_ER("No Object of  SaClmCluster Class was found");
goto done1;
-- 
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 1/1] imm: regenerate PBE on SQL constraint error [#2527]

2017-07-12 Thread Zoran Milinkovic
PBE will be regenerated on SQL constraint error code.
---
 src/imm/common/immpbe_dump.cc | 17 +
 1 file changed, 17 insertions(+)

diff --git a/src/imm/common/immpbe_dump.cc b/src/imm/common/immpbe_dump.cc
index 5185bb4..100222f 100644
--- a/src/imm/common/immpbe_dump.cc
+++ b/src/imm/common/immpbe_dump.cc
@@ -352,6 +352,7 @@ static void typeToPBE(SaImmAttrDefinitionT_2 *p, void 
*dbHandle,
 static void valuesToPBE(const SaImmAttrValuesT_2 *p, SaImmAttrFlagsT attrFlags,
 int objId, void *db_handle) {
   int rc = 0;
+  bool badfile = false;
   sqlite3 *dbHandle = (sqlite3 *)db_handle;
   sqlite3_stmt *stmt;
   int sqlIndex;
@@ -414,6 +415,9 @@ static void valuesToPBE(const SaImmAttrValuesT_2 *p, 
SaImmAttrFlagsT attrFlags,
 if (rc != SQLITE_DONE) {
   LOG_ER("SQL statement ('%s') failed with error code: %d\n",
  preparedSql[sqlIndex], rc);
+  if (rc == SQLITE_CONSTRAINT) {
+badfile = true;
+  }
   goto bailout;
 }
 sqlite3_reset(stmt);
@@ -424,6 +428,9 @@ static void valuesToPBE(const SaImmAttrValuesT_2 *p, 
SaImmAttrFlagsT attrFlags,
 
 bailout:
   sqlite3_close((sqlite3 *)dbHandle);
+  if (badfile) {
+discardPbeFile(*sPbeFileName);
+  }
   LOG_ER("Exiting (line:%u)", __LINE__);
   exit(1);
 }
@@ -2334,6 +2341,7 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   sqlite3 *dbHandle = (sqlite3 *)db_handle;
   sqlite3_stmt *stmt;
   bool rdnFound = false;
+  bool badfile = false;
 
   std::string sqlAttr;
 
@@ -2380,6 +2388,9 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
 LOG_ER("SQL statement('%s') failed with error code: %d",
preparedSql[SQL_INS_OBJECTS], rc);
+if (rc == SQLITE_CONSTRAINT) {
+  badfile = true;
+}
 goto bailout;
   }
   sqlite3_reset(stmt);
@@ -2447,6 +2458,9 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   if (rc != SQLITE_DONE) {
 LOG_ER("SQL object statement for table '%s' failed with error code: %d\n",
classNameString.c_str(), rc);
+if(rc == SQLITE_CONSTRAINT) {
+  badfile = true;
+}
 goto bailout;
   }
   sqlite3_reset(stmt);
@@ -2456,6 +2470,9 @@ bool objectToPBE(std::string objectNameString, const 
SaImmAttrValuesT_2 **attrs,
   return true;
 bailout:
   sqlite3_close(dbHandle);
+  if(badfile) {
+discardPbeFile(*sPbeFileName);
+  }
   return false;
 }
 
-- 
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 imm: regenerate PBE on SQL constraint error [#2527]

2017-07-12 Thread Zoran Milinkovic
Summary: imm: regenerate PBE on SQL constraint error [#2527]
Review request for Ticket(s): 2527
Peer Reviewer(s): Mahesh, Hung
Pull request to: Zoran or Hung
Affected branch(es): develop
Development branch: ticket-2527
Base revision: 3be8e9adb4670607a93907a886b0cf301570d65a
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 306efaabb70225703f57645adc2b645802e23d44
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 12 Jul 2017 14:01:51 +0200

imm: regenerate PBE on SQL constraint error [#2527]

PBE will be regenerated on SQL constraint error code.



Complete diffstat:
--
 src/imm/common/immpbe_dump.cc | 17 +
 1 file changed, 17 insertions(+)


Testing Commands:
-


Testing, Expected Results:
--
PBE should be regenerated on SQL constraint error code


Conditions of Submission:
-
Ack from Hung and Mahesh


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] clm: make CLM tests independent of other CLM tests [#2520]

2017-07-05 Thread Zoran Milinkovic
The patch removes dependencies between CLM tests. CLM tests can be run more 
times now.
Duplicated CLM tests are removed from clmtest.
---
 src/clm/apitest/clmtest.c   |  15 
 src/clm/apitest/tet_saClmClusterTrack.c | 130 +++-
 2 files changed, 94 insertions(+), 51 deletions(-)

diff --git a/src/clm/apitest/clmtest.c b/src/clm/apitest/clmtest.c
index 3e8d95e..683bfe4 100644
--- a/src/clm/apitest/clmtest.c
+++ b/src/clm/apitest/clmtest.c
@@ -38,6 +38,13 @@ SaNameT node_name;
 void clm_init(void)
 {
FILE *fp;
+   // Command list to execute before tests start
+   char *command[] = {
+   // Unlock PL-3
+   "immadm -o 1 safNode=PL-3,safCluster=myClmCluster 2> /dev/null"
+   };
+   int command_list_size = 1;
+   int i;
 
fp = fopen("/etc/opensaf/node_name", "r");
if (fp == NULL) {
@@ -49,6 +56,14 @@ void clm_init(void)
if (cnt == 1)
node_name.length = strlen((char *)node_name.value);
fclose(fp);
+
+   // Execute commands
+   for(i=0; i /dev/null", nodeName);
+   } else {
+   sprintf(command, "immadm -o 2 %s", nodeName);
+   }
+   return system(command);
+}
+
+static int clm_node_unlock(const char *nodeName, int ignoreOutput) {
+   char command[256];
+
+   if (ignoreOutput) {
+   sprintf(command, "immadm -o 1 %s 2> /dev/null", nodeName);
+   } else {
+   sprintf(command, "immadm -o 1 %s", nodeName);
+   }
+   return system(command);
+}
+
+static int clm_node_shutdown(const char *nodeName, int ignoreOutput) {
+   char command[256];
+
+   if (ignoreOutput) {
+   sprintf(command, "immadm -o 3 %s 2> /dev/null", nodeName);
+   } else {
+   sprintf(command, "immadm -o 3 %s", nodeName);
+   }
+   return system(command);
+}
+
+static void *admin_lock(void *dummy)
+{
+   assert(clm_node_lock(s_node_name, 0) != -1);
/*test_validate(WEXITSTATUS(rc), 0);*/
return NULL;
 }
 
 static void *admin_unlock(void *dummy)
 {
-   int rc;
-   char command[256];
-   char name[] = "safNode=PL-3,safCluster=myClmCluster";
-
-   sprintf(command, "immadm -o 1 %s", name);
-   assert((rc = system(command)) != -1);
+   assert(clm_node_unlock(s_node_name, 0) != -1);
/*test_validate(WEXITSTATUS(rc), 0);*/
return NULL;
 }
 
 static void *admin_shutdown(void *dummy)
 {
-   int rc;
-   char command[256];
-   char name[] = "safNode=PL-3,safCluster=myClmCluster";
-
-   sprintf(command, "immadm -o 3 %s", name);
-   assert((rc = system(command)) != -1);
+   assert(clm_node_shutdown(s_node_name, 0) != -1);
/*test_validate(WEXITSTATUS(rc), 0);*/
return NULL;
 }
@@ -68,9 +87,15 @@ static void saClmadmin_lock1(void)
char command[256];
char name[] = "safNode=PL-3,safCluster=myClmCluster";
 
+   // Lock node
+   clm_node_lock(name, 1);
+
sprintf(command, "immadm -o 2 %s", name);
assert((rc = system(command)) != -1);
test_validate(WEXITSTATUS(rc), 1);
+
+   // Reset CLM state
+   clm_node_unlock(name, 1);
 }
 
 static void saClmadmin_unlock1(void)
@@ -90,9 +115,15 @@ static void saClmadmin_shutdown1(void)
char command[256];
char name[] = "safNode=PL-3,safCluster=myClmCluster";
 
+   // Shutdown node
+   clm_node_shutdown(name, 1);
+
sprintf(command, "immadm -o 3 %s", name);
assert((rc = system(command)) != -1);
test_validate(WEXITSTATUS(rc), 1);
+
+   // Reset CLM state
+   clm_node_unlock(name, 1);
 }
 
 static void *plm_admin_trylock(void *dummy)
@@ -610,6 +641,9 @@ void saClmClusterTrack_21(void)
safassert(saClmClusterTrackStop(clmHandle), 

[devel] [PATCH 0/1] Review Request for clm: make CLM tests independent of other CLM tests [#2520]

2017-07-05 Thread Zoran Milinkovic
Summary: clm: make CLM tests independent of other CLM tests [#2520]
Review request for Ticket(s): 2520
Peer Reviewer(s): Anders, Praveen
Pull request to: Zoran
Affected branch(es): develop, release
Development branch: ticket-2520
Base revision: be6e036f1b3dc9582a6bc2013789fadc85e79aac
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 servicesn
 OpenSAF servicesn
 Core libraries  n
 Samples n
 Tests   y
 Other   n


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

revision d8dac2a5783f8d8b5b4c0b5a4a008a1e5f2c0d55
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 5 Jul 2017 16:44:24 +0200

clm: make CLM tests independent of other CLM tests [#2520]

The patch removes dependencies between CLM tests. CLM tests can be run more 
times now.
Duplicated CLM tests are removed from clmtest.



Complete diffstat:
--
 src/clm/apitest/clmtest.c   |  15 
 src/clm/apitest/tet_saClmClusterTrack.c | 130 +++-
 2 files changed, 94 insertions(+), 51 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
clmtest must pass all tests.
Each test manually executed more times must be successful.
Mostly tests from suite 7 are affected by this patch.


Conditions of Submission:
-
Ack from Anders and Praveeen


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 0/5] Review Request for ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]

2017-06-29 Thread Zoran Milinkovic
Hi Praveen,

I checked saImmOmClassDescriptionGet_2() and the function returns 
ERR_UNAVAILABLE only if IMM handle is initialized with A.2.18 and above version.

The problem here is that first OI handle is initialized with imm_version 
variable, which version is A.2.12. Then OM handle is initialized with the same 
variable.
So, here, after OI handle is initialized, imm_version is populated with the 
latest IMM version, A.2.18. And then you initialize OM handle with A.2.18 
version.

Thanks,
Zoran

-Original Message-
From: praveen malviya [mailto:praveen.malv...@oracle.com] 
Sent: den 29 juni 2017 06:52
To: Lennart Lund ; Minh Hon Chau 

Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 0/5] Review Request for ntf: ntfimcn does not 
handle SA_ERR_UNAVAILABLE [#2506]

Hi Lennart,

NTFIMCN initializes with IMM with SAF version A.02.12.
IMM integration with CLM is done in last release and for that SAF version is 
A.02.18 (src/imm/README mentions it).
Like any legacy application, NTFIMCN should not get ERR_UNAVAILABLE from IMM 
for any API call.

Thanks,
Praveen



On 28-Jun-17 8:48 PM, Lennart Lund wrote:
> Summary: ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506] 
> Review request for Ticket(s): 2506 Peer Reviewer(s): 
> praveen.malv...@oracle.com; minh.c...@dektech.com.au Pull request to: 
> *** LIST THE PERSON WITH PUSH ACCESS HERE *** Affected branch(es): 
> develop Development branch: ticket-2506 Base revision: 
> f089f030a322a43c79f3f259f07a4c42bb4d0da1
> Personal repository: git://git.code.sf.net/u/elunlen/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):
> -
> *** EXPLAIN/COMMENT THE PATCH SERIES HERE ***
> 
> revision beae5c3dacaa05fe68b50433251947d8c045cca7
> Author:   Lennart Lund 
> Date: Wed, 28 Jun 2017 17:09:23 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> Changed according to comment from Minh.
> OM Handle is now initialized only when imcn process start and is 
> reinitialized if SA_AIS_ERR_UNAVAILABLE Also comment about resource 
> handling in case of error in get_rdn_attr_name()
> 
> 
> 
> revision 7c3bc31dda6099becf7f246093d0bd7b0d652340
> Author:   Lennart Lund 
> Date: Wed, 28 Jun 2017 16:49:04 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> Changed according to comment from Minh.
> OM Handle is now initialized only when imcn process start and is 
> reinitialized if SA_AIS_ERR_UNAVAILABLE Also comment about resource 
> handling in case of error in get_rdn_attr_name()
> 
> long_description
> 
> 
> 
> revision caa854ce873f90208a5a14894b51c997e25a924c
> Author:   Lennart Lund 
> Date: Wed, 28 Jun 2017 16:49:04 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> In ntfimcn the OM handle shall have a short lifespan. Change from 
> creating a handle once when ntfimcn process starts to create a handle 
> each time it is needed and finalize when no longer needed.
> 
> 
> 
> revision 0db3b249ffa8d00b05cc7aefecb1d422c30c8faf
> Author:   Lennart Lund 
> Date: Wed, 28 Jun 2017 16:49:04 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> In ntfimcn the OM handle shall have a short lifespan. Change from 
> creating a handle once when ntfimcn process starts to create a handle 
> each time it is needed and finalize when no longer needed.
> 
> Change start handling of ntfimcn (in ntf process) so the ntfimcn 
> process is started on the active node only since the ntfimcn process 
> is not doing anything on the standby node. Refactor/simplify code accordingly.
> 
> 
> 
> revision 71763df94b6d58d6e553fa26cc41dbd7cb7d264a
> Author:   Lennart Lund 
> Date: Tue, 27 Jun 2017 16:05:44 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> In ntfimcn the OM handle shall have a short lifespan. Change from 
> creating a handle once when ntfimcn process starts to create a handle 
> each time it is needed and finalize when no longer needed.
> 
> 
> 
> revision 8f43f5d28b282812926d5a5bad29e604c76e4697
> Author:   Lennart Lund 
> Date: Mon, 26 Jun 2017 14:03:38 +0200
> 
> ntf: ntfimcn does not handle SA_ERR_UNAVAILABLE [#2506]
> 
> In ntfimcn the OM handle shall have a short lifespan. Change from 
> creating a handle once when ntfimcn process starts to create a 

[devel] [PATCH 1/1] imm: send imm finalize message to immnd when dispatch returns ERR_BAD_HANDLE [#2504]

2017-06-28 Thread Zoran Milinkovic
Send IMM_FINALIZE message to immnd when dispatch functions returns 
ERR_BAD_HANDLE.
IMM_FINALIZE will release all allocated resources of a handle on IMM service 
side.
---
 src/imm/agent/imma_proc.cc | 51 ++
 1 file changed, 51 insertions(+)

diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc
index 14ce5ab..dfd73e3 100644
--- a/src/imm/agent/imma_proc.cc
+++ b/src/imm/agent/imma_proc.cc
@@ -1745,6 +1745,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_one(IMMA_CB *cb, 
SaImmHandleT immHandle) {
   imma_proc_ccbaug_setup(cl_node, callback);
   m_NCS_UNLOCK(>cb_lock, NCS_LOCK_WRITE);
   if (!imma_process_callback_info(cb, cl_node, callback, immHandle)) {
+IMMSV_EVT finalize_evt, *out_evt;
 /* Callback protocol could not be honored due to some lack
of client capabilities. E.g. applier can not handle long DNs
while regular OI can, or there is no regular OI. The capabilties
@@ -1757,6 +1758,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_one(IMMA_CB *cb, 
SaImmHandleT immHandle) {
 */
 cl_node->stale = true;
 cl_node->exposed = true;
+
+out_evt = NULL;
+memset(_evt, 0, sizeof(IMMSV_EVT));
+finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+finalize_evt.info.immnd.info.finReq.client_hdl = cl_node->handle;
+
+/* send the request to the IMMND */
+imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+   _evt, _evt,
+   cl_node->syncr_timeout);
+
+if (out_evt) {
+  free(out_evt);
+}
+
 return SA_AIS_ERR_BAD_HANDLE;
   }
   return SA_AIS_OK;
@@ -1810,6 +1827,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_all(IMMA_CB *cb, 
SaImmHandleT immHandle) {
   imma_proc_ccbaug_setup(cl_node, callback);
   m_NCS_UNLOCK(>cb_lock, NCS_LOCK_WRITE);
   if (!imma_process_callback_info(cb, cl_node, callback, immHandle)) {
+IMMSV_EVT finalize_evt, *out_evt;
 /* Callback protocol could not be honored due to some lack
of client capabilities. E.g. applier can not handle long DNs
while regular OI can, or there is no regular OI. The capabilties
@@ -1822,6 +1840,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_all(IMMA_CB *cb, 
SaImmHandleT immHandle) {
 */
 cl_node->stale = true;
 cl_node->exposed = true;
+
+out_evt = NULL;
+memset(_evt, 0, sizeof(IMMSV_EVT));
+finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+finalize_evt.info.immnd.info.finReq.client_hdl = cl_node->handle;
+
+/* send the request to the IMMND */
+imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+   _evt, _evt,
+   cl_node->syncr_timeout);
+
+if (out_evt) {
+  free(out_evt);
+}
+
 return SA_AIS_ERR_BAD_HANDLE;
   }
 } else {
@@ -1903,6 +1937,7 @@ SaAisErrorT imma_hdl_callbk_dispatch_block(IMMA_CB *cb,
 imma_proc_ccbaug_setup(client_info, callback);
 m_NCS_UNLOCK(>cb_lock, NCS_LOCK_WRITE);
 if (!imma_process_callback_info(cb, client_info, callback, immHandle)) 
{
+  IMMSV_EVT finalize_evt, *out_evt;
   /* Callback protocol could not be honored due to some lack
  of client capabilities. E.g. applier can not handle long DNs
  while regular OI can, or there is no regular OI. The capabilties
@@ -1915,6 +1950,22 @@ SaAisErrorT imma_hdl_callbk_dispatch_block(IMMA_CB *cb,
*/
   client_info->stale = true;
   client_info->exposed = true;
+
+  out_evt = NULL;
+  memset(_evt, 0, sizeof(IMMSV_EVT));
+  finalize_evt.type = IMMSV_EVT_TYPE_IMMND;
+  finalize_evt.info.immnd.type = IMMND_EVT_A2ND_IMM_FINALIZE;
+  finalize_evt.info.immnd.info.finReq.client_hdl = client_info->handle;
+
+  /* send the request to the IMMND */
+  imma_mds_msg_sync_send(cb->imma_mds_hdl, &(cb->immnd_mds_dest),
+ _evt, _evt,
+ client_info->syncr_timeout);
+
+  if (out_evt) {
+free(out_evt);
+  }
+
   return SA_AIS_ERR_BAD_HANDLE;
 }
   } else {
-- 
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 1/1] rde: allow early role change when active or standby nodes are introduced [#2513]

2017-06-28 Thread Zoran Milinkovic
When active or standby nodes are introduced with request message, there is no 
need to wait more for requesting the active role.
When standby node is introduced, then we are sure that there is an active node 
somewhere in the cluster. So, changing the peer state is safe.
---
 src/rde/rded/rde_main.cc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/rde/rded/rde_main.cc b/src/rde/rded/rde_main.cc
index e939517..40d5d8e 100644
--- a/src/rde/rded/rde_main.cc
+++ b/src/rde/rded/rde_main.cc
@@ -103,7 +103,10 @@ static void handle_mbx_event() {
   LOG_NO("Got peer info request from node 0x%x with role %s",
  msg->fr_node_id, Role::to_string(msg->info.peer_info.ha_role));
   CheckForSplitBrain(msg);
-  role->SetPeerState(msg->info.peer_info.ha_role, msg->fr_node_id);
+  if(msg->info.peer_info.ha_role == PCS_RDA_ACTIVE
+  || msg->info.peer_info.ha_role == PCS_RDA_STANDBY) {
+role->SetPeerState(msg->info.peer_info.ha_role, msg->fr_node_id);
+  }
   SendPeerInfoResp(msg->fr_dest);
   break;
 }
-- 
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 rde: allow early role change when active or standby nodes are introduced [#2513]

2017-06-28 Thread Zoran Milinkovic
Summary: rde: allow early role change when active or standby nodes are 
introduced [#2513]
Review request for Ticket(s): 2513
Peer Reviewer(s): Anders
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2513
Base revision: 7193ab9d6261f13efe5ce173f3b9bee248401ef3
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 servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


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

revision f089f030a322a43c79f3f259f07a4c42bb4d0da1
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 28 Jun 2017 13:25:29 +0200

rde: allow early role change when active or standby nodes are introduced [#2513]

When active or standby nodes are introduced with request message, there is no 
need to wait more for requesting the active role.
When standby node is introduced, then we are sure that there is an active node 
somewhere in the cluster. So, changing the peer state is safe.



Complete diffstat:
--
 src/rde/rded/rde_main.cc | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Anders


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: Allow stale clients to be discarded when going to headless [#2487]

2017-06-14 Thread Zoran Milinkovic
Hi Hung,

Reviewed the code.
Ack from me.

Thanks,
Zoran


-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 9 juni 2017 08:41
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; mahesh.va...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Allow stale clients to be discarded when going to 
headless [#2487]

Just like immnd_proc_imma_discard_stales(), in immnd_proc_discard_other_nodes() 
we should unset the mIsStale flag of the clients.
So that the clients can be discarded.
---
 src/imm/immnd/immnd_proc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c index 
2bba717..22f8737 100644
--- a/src/imm/immnd/immnd_proc.c
+++ b/src/imm/immnd/immnd_proc.c
@@ -2824,6 +2824,7 @@ void immnd_proc_discard_other_nodes(IMMND_CB *cb)
while (cl_node) {
LOG_NO("Removing client id:%llx sv_id:%u", cl_node->imm_app_hdl,
   cl_node->sv_id);
+   cl_node->mIsStale = false;
osafassert(
immnd_proc_imma_discard_connection(cb, cl_node, true));
osafassert(immnd_client_node_del(cb, cl_node) ==
--
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] imm: fix counting timeouts for old critical CCBs [#2495]

2017-06-14 Thread Zoran Milinkovic
Hi Mahesh,

The first IF block should be executed if (*i)->mWaitStartTime is not 0 (in 
timespec).
osaf_timespec_compare(&(*i)->mWaitStartTime, ) checks if 
(*i)->mWaitStartTime is 0 or not. -1 is not 0 (FALSE), and IF block will be 
executed.

I don't see problem here.

Thanks,
Zoran

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: den 14 juni 2017 12:13
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: fix counting timeouts for old critical CCBs 
[#2495]

Hi Zora,

ACK  form me.

Note : osaf_timespec_compare() will also returns  -1 , please cross check once 
the logic at very fist if() condition of void ImmModel::getOldCriticalCcbs() 
looks OK to me .

-AVM


On 6/14/2017 3:03 PM, Zoran Milinkovic wrote:
> The patch fix counting timeouts for old critical CCBs
> ---
>   src/imm/immnd/ImmModel.cc | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc 
> index 25f8621..d76142e 100644
> --- a/src/imm/immnd/ImmModel.cc
> +++ b/src/imm/immnd/ImmModel.cc
> @@ -14240,7 +14240,7 @@ void ImmModel::getOldCriticalCcbs(IdVector& cv, 
> SaUint32T* pbeConnPtr,
> }
>   
> if ((ccb->mPbeRestartId == 0) &&
> -  osaf_timer_is_expired_sec(, >mWaitStartTime,
> +  !osaf_timer_is_expired_sec(, >mWaitStartTime,
>   (DEFAULT_TIMEOUT_SEC + addSecs))) {
>   timespec elapsed;
>   osaf_timespec_subtract(, >mWaitStartTime, 
> );

--
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: fix counting timeouts for old critical CCBs [#2495]

2017-06-14 Thread Zoran Milinkovic
The patch fix counting timeouts for old critical CCBs
---
 src/imm/immnd/ImmModel.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc
index 25f8621..d76142e 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -14240,7 +14240,7 @@ void ImmModel::getOldCriticalCcbs(IdVector& cv, 
SaUint32T* pbeConnPtr,
   }
 
   if ((ccb->mPbeRestartId == 0) &&
-  osaf_timer_is_expired_sec(, >mWaitStartTime,
+  !osaf_timer_is_expired_sec(, >mWaitStartTime,
 (DEFAULT_TIMEOUT_SEC + addSecs))) {
 timespec elapsed;
 osaf_timespec_subtract(, >mWaitStartTime, );
-- 
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 imm: fix counting timeouts for old critical CCBs [#2495]

2017-06-14 Thread Zoran Milinkovic
Summary: imm: fix counting timeouts for old critical CCBs [#2495]
Review request for Ticket(s): 2495
Peer Reviewer(s): Hung, Mahesh
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2495
Base revision: db1965d634eac2f375f455b7b7d3e9f70ff0c47c
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 dcd53316bf6a294b439403a81daa25715fa022c7
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Wed, 14 Jun 2017 11:27:40 +0200

imm: fix counting timeouts for old critical CCBs [#2495]

The patch fix counting timeouts for old critical CCBs



Complete diffstat:
--
 src/imm/immnd/ImmModel.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Testing Commands:
-


Testing, Expected Results:
--


Conditions of Submission:
-
Ack from Hung and Mahesh


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] immtest: Explicitly clear implementer name in OI long DN testcases [#2484]

2017-06-09 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 6 juni 2017 09:41
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; mahesh.va...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] immtest: Explicitly clear implementer name in OI long DN 
testcases [#2484]

Explicitly clear implementer name in OI long DN testcases.
---
 src/imm/apitest/implementer/test_saImmOiLongDn.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/src/imm/apitest/implementer/test_saImmOiLongDn.c 
b/src/imm/apitest/implementer/test_saImmOiLongDn.c
index d3912c1..210c7c4 100644
--- a/src/imm/apitest/implementer/test_saImmOiLongDn.c
+++ b/src/imm/apitest/implementer/test_saImmOiLongDn.c
@@ -276,6 +276,7 @@ static void saImmOiLongDn_01(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
config_class_delete(immOmHandle);
@@ -350,6 +351,7 @@ static void saImmOiLongDn_02(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
@@ -415,6 +417,7 @@ static void saImmOiLongDn_03(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
@@ -470,6 +473,7 @@ static void saImmOiLongDn_04(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
@@ -550,6 +554,7 @@ static void saImmOiLongDn_05(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
@@ -627,6 +632,7 @@ static void saImmOiLongDn_06(void)
pthread_join(threadid, NULL);
close_stop_fd();
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
@@ -658,6 +664,7 @@ static void saImmOiLongDn_07(void)
 SA_IMM_ONE);
}
 
+   safassert(saImmOiImplementerClear(immOiHandle), SA_AIS_OK);
safassert(saImmOiFinalize(immOiHandle), SA_AIS_OK);
 
test_validate(rc, SA_AIS_OK);
-- 
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] imm: remove vector clearing for dead implementers, nodes and admin owners in objectSync [#2481]

2017-06-05 Thread Zoran Milinkovic
Hi Mahesh,

Performance is not an issue here. Only the syncing node is affected by this 
change.

I'm not sure I understand what you meant with "partial stale data in syncing 
node".

During the sync, IMM DB is locked. Veteran nodes are read-only (R_AVAILABLE 
state), and syncing nodes are write-only (W_AVAILABLE state).

While veteran nodes are in R_AVAILABLE state, they only check their data with 
syncing data, but do not update any data.

BR,
Zoran


-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com] 
Sent: den 5 juni 2017 12:13
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [PATCH 1/1] imm: remove vector clearing for dead implementers, 
nodes and admin owners in objectSync [#2481]

Hi Zoran,

On 6/5/2017 2:01 PM, Zoran Milinkovic wrote:
> The earlier code clears that vector on each sync object, and reexecuting 
> discard node is not possible when sync is done.
>
> The same is for dead implementers and admin owners.
ACK from me with following :

I understand clearing that vector on each sync object expensive and 
performance issue also,
but it will keep update sync data, if having partial stale data in 
syncing node is harmless ( I hope IMM DB locked while syncing node)
ACK from me ,please check the above before committing.

-AVM

On 6/5/2017 2:01 PM, Zoran Milinkovic wrote:
> Hi Mahesh,
>
> You have understood correct.
>
> During the sync, it's not possible to discard node on a node that is going to 
> be synced.
> The data of discarded node is saved in a vector, and discard node should be 
> executed again when the sync is done.
>
> The earlier code clears that vector on each sync object, and reexecuting 
> discard node is not possible when sync is done.
>
> The same is for dead implementers and admin owners.
>
> Thanks,
> Zoran
>
> -Original Message-
> From: A V Mahesh [mailto:mahesh.va...@oracle.com]
> Sent: den 5 juni 2017 07:13
> To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: Re: [PATCH 1/1] imm: remove vector clearing for dead 
> implementers, nodes and admin owners in objectSync [#2481]
>
> Hi Zoran,
>
> On 6/2/2017 8:45 PM, Zoran Milinkovic wrote:
>> After removing the clearing of dead implementer, node and admin owner 
>> vectors, re-executing on vectors will be done after the node is fully synced.
> Just Trying to understand the problem more , I understand problem as follows 
> please confirm :
>
> In a cluster,  some payloads  are already  exist/synced and their NODE STATE 
> is  FULLY_AVAILABLE , at that moment  few more  payloads are trying join 
> cluster and while those new  payloads  sync is in progress ,  one of the 
> existing payload left the cluster and Global discard node received for that 
> node.
>
> Because of  the new  payloads is busy in sync itself , the discard node 
> cleanup was not done at that moment by the newly joining node and is got 
> pending , this patch is making sure the pending cleanup of discarded node  by 
> newly joined node , it my under standing ring ?
>
> -AVM
>
> On 6/2/2017 8:45 PM, Zoran Milinkovic wrote:
>> After removing the clearing of dead implementer, node and admin owner 
>> vectors, re-executing on vectors will be done after the node is fully synced.
>> ---
>>src/imm/immnd/ImmModel.cc | 12 
>>1 file changed, 12 deletions(-)
>>
>> diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc 
>> index 25f8621..64a24e9 100644
>> --- a/src/imm/immnd/ImmModel.cc
>> +++ b/src/imm/immnd/ImmModel.cc
>> @@ -18853,18 +18853,6 @@ SaAisErrorT ImmModel::objectSync(const 
>> ImmsvOmObjectSync* req) {
>>  }
>>
>>objectSyncExit:
>> -  sImplsDeadDuringSync.clear();
>> -  sNodesDeadDuringSync.clear();
>> -  sAdmosDeadDuringSync.clear();
>> -  /* Clear the "tombstones" for Implementers and Nodes for each sync message
>> - received. The tiny hole that we need to plug only exists after the
>> - last sync message, when coord sends the finalizeSync message until
>> - everyone receives it. Nodes may receive discardImplementer or
>> - discardNode messages over fevs before receiving finalizeSync.
>> - These nodes/implementers will still be part of the finalizeSync
>> - message, causing apparent verification failure in veterans and
>> - incorrectly installed implementers in sync clients.
>> -   */
>>  TRACE_LEAVE();
>>  return err;
>>}

--
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 mLastResult before sending response to agent [#2470]

2017-05-29 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 29 maj 2017 12:34
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Clear mLastResult before sending response to agent 
[#2470]

In immnd_evt_proc_search_next(), before jumping to agent_rsp, mLastResult must 
be cleared.
So that it will not be freed again in immnd_proc_imma_discard_connection().
---
 src/imm/immnd/immnd_evt.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/imm/immnd/immnd_evt.c b/src/imm/immnd/immnd_evt.c index 
cacf4d5..3f8ef10 100644
--- a/src/imm/immnd/immnd_evt.c
+++ b/src/imm/immnd/immnd_evt.c
@@ -1844,6 +1844,7 @@ static uint32_t immnd_evt_proc_search_next(IMMND_CB *cb, 
IMMND_EVT *evt,
/*Fetch client node for OI ! */
immnd_client_node_get(cb, implHandle, _cl_node);
if (oi_cl_node == NULL || oi_cl_node->mIsStale) {
+   immModel_clearLastResult(sn->searchOp);
LOG_WA(
"ERR_NO_RESOURCES: SearchNext: Implementer 
died during fetch of pure RTA");
error = SA_AIS_ERR_NO_RESOURCES;
@@ -1856,6 +1857,7 @@ static uint32_t immnd_evt_proc_search_next(IMMND_CB *cb, 
IMMND_EVT *evt,
cb, NCSMDS_SVC_ID_IMMA_OI,
oi_cl_node->agent_mds_dest,
_evt) != NCSCC_RC_SUCCESS) {
+   immModel_clearLastResult(sn->searchOp);
LOG_WA(
"ERR_NO_RESOURCES: SearchNext - 
Agent upcall over MDS for rtUpdate failed");
error = SA_AIS_ERR_NO_RESOURCES;
@@ -1884,6 +1886,7 @@ static uint32_t immnd_evt_proc_search_next(IMMND_CB *cb, 
IMMND_EVT *evt,
rc = immnd_mds_msg_send(cb, NCSMDS_SVC_ID_IMMND,
implDest, _evt);
if (rc != NCSCC_RC_SUCCESS) {
+   immModel_clearLastResult(sn->searchOp);
LOG_ER(
"ERR_NO_RESOURCES: SearchNext - Problem in 
sending to peer IMMND over MDS. Aborting searchNext.");
error = SA_AIS_ERR_NO_RESOURCES;
--
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 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 <zoran.milinko...@ericsson.com>
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


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 <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
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.sourcefor

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 <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
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


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 <zoran.milinko...@ericsson.com>; 
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<mailto:hung.d.ngu...@dektech.com.au>

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

To: Zoran Milinkovic, Neelakanta Reddy

zoran.milinko...@ericsson.com<mailto:zoran.milinko...@ericsson.com>, 
reddy.neelaka...@oracle.com<mailto:reddy.neelaka...@oracle.com>

Cc: Opensaf-devel, Hung Nguyen


opensaf-devel@lists.sourceforge.net<mailto:opensaf-devel@lists.sourceforge.net>,
 hung.d.ngu...@dektech.com.au<mailto: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

Re: [devel] [PATCH 1/1] imm: Skip sending re-intro message if IMMD is not up [#2447]

2017-05-18 Thread Zoran Milinkovic
Hi Hung,

Reviewed the code.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 9 maj 2017 10:29
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Skip sending re-intro message if IMMD is not up 
[#2447]

Skip sending re-intro message if IMMD is not up.
---
 src/imm/immnd/immnd_mds.c  | 1 +
 src/imm/immnd/immnd_proc.c | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/src/imm/immnd/immnd_mds.c b/src/imm/immnd/immnd_mds.c index 
76ba77a..dd5ca83 100644
--- a/src/imm/immnd/immnd_mds.c
+++ b/src/imm/immnd/immnd_mds.c
@@ -593,6 +593,7 @@ static uint32_t immnd_mds_svc_evt(IMMND_CB *cb,
case NCSMDS_DOWN:
TRACE("IMMD SERVICE DOWN => CLUSTER GOING DOWN");
cb->fevs_replies_pending = 0;
+   cb->is_immd_up = false;
break;
 
case NCSMDS_UP:
diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c index 
74cd24f..2bba717 100644
--- a/src/imm/immnd/immnd_proc.c
+++ b/src/imm/immnd/immnd_proc.c
@@ -494,6 +494,12 @@ uint32_t immnd_introduceMe(IMMND_CB *cb)
memset(_evt, '\0', sizeof(IMMSV_EVT));
 
if (cb->mIntroduced == 2) {
+   /* Skip sending if IMMD is not up */
+   if (!cb->is_immd_up) {
+   TRACE("IMMD is not up, skip sending re-intro message");
+   rc = NCSCC_RC_FAILURE;
+   goto error;
+   }
/* Check for syncPid and pbePid, intro message will not be sent
 * until they all exit */
if (cb->syncPid > 0) {
--
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] smf: Attribute value handling in longDn applier is incorrect [#2442]

2017-04-27 Thread Zoran Milinkovic
Hi Lennart,

You have a typo in the comment you've changed.
SMF is only interested in longDnsAllowed attribute, and not in 
opensafNetworkName

Thanks,
Zoran

-Original Message-
From: Lennart Lund [mailto:lennart.l...@ericsson.com] 
Sent: den 27 april 2017 15:10
To: reddy.neelaka...@oracle.com; Rafael Odzakow 
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 1/1] smf: Attribute value handling in longDn applier is 
incorrect [#2442]

SMF has an IMM applier to track changes of attribute longDnsAllowed in 
OpensafImm class.
Fix that the applier does not find the value if the list of attributes to be 
handled in the
apply callback contains more than one attribute. Also if the found attribute is 
not the serached
one the cached attribute value is set to invalid
---
 src/smf/smfd/SmfImmApplierHdl.cc | 28 +++-
 1 file changed, 15 insertions(+), 13 deletions(-)

diff --git a/src/smf/smfd/SmfImmApplierHdl.cc b/src/smf/smfd/SmfImmApplierHdl.cc
index d325ec4..693446b 100644
--- a/src/smf/smfd/SmfImmApplierHdl.cc
+++ b/src/smf/smfd/SmfImmApplierHdl.cc
@@ -436,15 +436,12 @@ static void CcbApplyCallback(SaImmOiHandleT immOiHandle, 
SaImmOiCcbIdT ccbId) {
 
   objName = osaf_extended_name_borrow(>objectName);
   if (object_name_.compare(objName) != 0) {
-TRACE("%s: Object \"%s\" not an OpensafConfig object", __FUNCTION__,
-  objName);
+LOG_NO("%s: Object \"%s\" wrong object", __FUNCTION__, objName);
 goto done;
   }
 
-  /* Read value in opensafNetworkName
-   * Note: This is implemented as a loop in case more attributes are
-   *   added in the class in the future. For now the only
-   *   attribute of interest here is opensafNetworkName
+  /* Read value
+   * Note: For now the only attribute of interest here is opensafNetworkName
*/
   TRACE("%s: Read value in attributes", __FUNCTION__);
   attrMod = opdata->param.modify.attrMods[0];
@@ -455,21 +452,26 @@ static void CcbApplyCallback(SaImmOiHandleT immOiHandle, 
SaImmOiCcbIdT ccbId) {
 if (attribute_name_.compare(attribute.attrName) != 0) {
   // Not found
   attrMod = opdata->param.modify.attrMods[i];
+  attribute = attrMod->modAttr;
   continue;
 }
 
 // Attribute found
 value = static_cast(attribute.attrValues[0]);
+TRACE("Attribute found: attrName '%s', value = %d",
+  attribute.attrName, *value);
 break;
   }
 
-  if (value == nullptr) {
-TRACE("%s: Value is nullptr", __FUNCTION__);
-SetAttributeValue("");
-attribute_value_is_valid_ = false;
-  } else {
-SetAttributeValue(std::to_string(*value));
-attribute_value_is_valid_ = true;
+  if (attrMod != nullptr) {
+if (value == nullptr) {
+  TRACE("%s: Value is nullptr", __FUNCTION__);
+  SetAttributeValue("");
+  attribute_value_is_valid_ = false;
+} else {
+  SetAttributeValue(std::to_string(*value));
+  attribute_value_is_valid_ = true;
+}
   }
 
 done:
-- 
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

--
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: Improve ccb error string handling [#2367]

2017-04-26 Thread Zoran Milinkovic
Hi Hieu,

Reviewed the patch and IMM code again.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com] 
Sent: den 25 april 2017 13:33
To: Hieu Thanh Nguyen <hieu.t.ngu...@dektech.com.au>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] imm: Improve ccb error string handling [#2367]

Hi Hieu,

Please check all calls of immModel_setCcbErrorString() in immnd_evt.c.
You are referring only to setCcbErrorString from ImmModel.cc.

Example:
if (pbeNodeIdPtr && pbeConn && err == SA_AIS_OK) {
/*The persistent back-end is present and executing at THIS node.
 */
...
immModel_setCcbErrorString(
cb, evt->info.objModify.ccbId,
IMM_RESOURCE_ABORT "PBE is down");

Thanks,
Zoran

-Original Message-
From: Hieu Thanh Nguyen
Sent: den 25 april 2017 05:01
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

Hi Zoran,

Before my patch apply:
+ CCB error strings (related PBE) stored on node PBE reside.
+ Only OM same node with PBE receive this error strings.
if ((err == SA_AIS_OK) && pbeNodeIdPtr) {
  void* pbe = getPbeOi(pbeConnPtr, pbeNodeIdPtr);
  if (!pbe) {

setCcbErrorString(ccb, IMM_RESOURCE_ABORT "PBE is down");
  }
    
}

After My patch apply:
+ OM only store CBB error strings of originating node.

I don't see any change Before and After my patch apply relate CBB error string 
(related PBE) ?

Thanks,
Hieu

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
Sent: Friday, April 21, 2017 5:54 PM
To: Hieu Thanh Nguyen <hieu.t.ngu...@dektech.com.au>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Hieu Thanh Nguyen 
<hieu.t.ngu...@dektech.com.au>
Subject: RE: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

Hi Hieu,

This code will not work with CCB error strings related with PBE.
PBE can be running on a different node than the originating node.

Thanks,
Zoran

-Original Message-
From: Hieu Nguyen [mailto:hieu.t.ngu...@dektech.com.au]
Sent: den 21 april 2017 09:27
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Hieu Thanh Nguyen 
<hieu.t.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

---
 src/imm/immnd/ImmModel.cc | 61
+++
 1 file changed, 9 insertions(+), 52 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index
35c8a31..e337231 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -10734,6 +10734,12 @@ void ImmModel::setCcbErrorString(CcbInfo* ccb, const 
char* errorString,
   va_list args;
   int isValidationErrString = 0;
 
+  // Only store error strings on originating node where OM client resides.
+  if ((ccb->mAugCcbParent && !ccb->mAugCcbParent->mOriginatingConn) ||
+  (!ccb->mOriginatingConn)) {
+return;
+  }
+
   va_copy(args, vl);
   len = vsnprintf(fmtError, errLen, errorString, args);
   va_end(args);
@@ -11135,35 +11141,11 @@ void
ImmModel::ccbObjDelContinuation(immsv_oi_ccb_upcall_rsp* rsp,
 // imm implementation has the right to veto any ccb at any time.
   }
 
-  if (rsp->errorString.size && ccb->mOriginatingConn) {
+  if (rsp->errorString.size) {
 /*Collect err strings, see: http://devel.opensaf.org/ticket/1904
   Only done at originating node since that is where the OM
   client resides. */
-unsigned int ix = 0;
-ImmsvAttrNameList* errStr = ccb->mErrorStrings;
-ImmsvAttrNameList** errStrTail = &(ccb->mErrorStrings);
-while (errStr) {
-  if (!strncmp(rsp->errorString.buf, errStr->name.buf,
-   rsp->errorString.size)) {
-TRACE_5("Discarding duplicate error string '%s' for ccb id %u",
-rsp->errorString.buf, ccbId);
-return;
-  }
-  ++ix;
-  errStrTail = &(errStr->next);
-  errStr = errStr->next;
-}
-
-if (ix >= IMMSV_MAX_ATTRIBUTES) {
-  TRACE_5("Discarding error string '%s' for ccb id %u (too many)",
-  rsp->err

Re: [devel] [PATCH 1/1] imm: Improve ccb error string handling [#2367]

2017-04-25 Thread Zoran Milinkovic
Hi Hieu,

Please check all calls of immModel_setCcbErrorString() in immnd_evt.c.
You are referring only to setCcbErrorString from ImmModel.cc.

Example:
if (pbeNodeIdPtr && pbeConn && err == SA_AIS_OK) {
/*The persistent back-end is present and executing at THIS node.
 */
...
immModel_setCcbErrorString(
cb, evt->info.objModify.ccbId,
IMM_RESOURCE_ABORT "PBE is down");

Thanks,
Zoran

-Original Message-
From: Hieu Thanh Nguyen 
Sent: den 25 april 2017 05:01
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

Hi Zoran,

Before my patch apply:
+ CCB error strings (related PBE) stored on node PBE reside.
+ Only OM same node with PBE receive this error strings.
if ((err == SA_AIS_OK) && pbeNodeIdPtr) {
  void* pbe = getPbeOi(pbeConnPtr, pbeNodeIdPtr);
  if (!pbe) {

setCcbErrorString(ccb, IMM_RESOURCE_ABORT "PBE is down");
  }
    
}

After My patch apply:
+ OM only store CBB error strings of originating node.

I don't see any change Before and After my patch apply relate CBB error string 
(related PBE) ?

Thanks,
Hieu

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
Sent: Friday, April 21, 2017 5:54 PM
To: Hieu Thanh Nguyen <hieu.t.ngu...@dektech.com.au>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Hieu Thanh Nguyen 
<hieu.t.ngu...@dektech.com.au>
Subject: RE: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

Hi Hieu,

This code will not work with CCB error strings related with PBE.
PBE can be running on a different node than the originating node.

Thanks,
Zoran

-Original Message-
From: Hieu Nguyen [mailto:hieu.t.ngu...@dektech.com.au]
Sent: den 21 april 2017 09:27
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Hieu Thanh Nguyen 
<hieu.t.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

---
 src/imm/immnd/ImmModel.cc | 61
+++
 1 file changed, 9 insertions(+), 52 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index
35c8a31..e337231 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -10734,6 +10734,12 @@ void ImmModel::setCcbErrorString(CcbInfo* ccb, const 
char* errorString,
   va_list args;
   int isValidationErrString = 0;
 
+  // Only store error strings on originating node where OM client resides.
+  if ((ccb->mAugCcbParent && !ccb->mAugCcbParent->mOriginatingConn) ||
+  (!ccb->mOriginatingConn)) {
+return;
+  }
+
   va_copy(args, vl);
   len = vsnprintf(fmtError, errLen, errorString, args);
   va_end(args);
@@ -11135,35 +11141,11 @@ void
ImmModel::ccbObjDelContinuation(immsv_oi_ccb_upcall_rsp* rsp,
 // imm implementation has the right to veto any ccb at any time.
   }
 
-  if (rsp->errorString.size && ccb->mOriginatingConn) {
+  if (rsp->errorString.size) {
 /*Collect err strings, see: http://devel.opensaf.org/ticket/1904
   Only done at originating node since that is where the OM
   client resides. */
-unsigned int ix = 0;
-ImmsvAttrNameList* errStr = ccb->mErrorStrings;
-ImmsvAttrNameList** errStrTail = &(ccb->mErrorStrings);
-while (errStr) {
-  if (!strncmp(rsp->errorString.buf, errStr->name.buf,
-   rsp->errorString.size)) {
-TRACE_5("Discarding duplicate error string '%s' for ccb id %u",
-rsp->errorString.buf, ccbId);
-return;
-  }
-  ++ix;
-  errStrTail = &(errStr->next);
-  errStr = errStr->next;
-}
-
-if (ix >= IMMSV_MAX_ATTRIBUTES) {
-  TRACE_5("Discarding error string '%s' for ccb id %u (too many)",
-  rsp->errorString.buf, ccbId);
-} else {
-  (*errStrTail) =
(ImmsvAttrNameList*)malloc(sizeof(ImmsvAttrNameList));
-  (*errStrTail)->next = NULL;
-  (*errStrTail)->name.size = rsp->errorString.size;
-  (*errStrTail)->name.buf = rsp->errorString.buf;
-  rsp->errorString.buf = NULL; /* steal */
-}
+setCcbErrorString(ccb, rsp->errorString.buf);
   }
 }
   }
@@ -11299,32 +11281,7 @@ void

Re: [devel] [PATCH 1/1] imm: Improve ccb error string handling [#2367]

2017-04-21 Thread Zoran Milinkovic
Hi Hieu,

This code will not work with CCB error strings related with PBE.
PBE can be running on a different node than the originating node.

Thanks,
Zoran

-Original Message-
From: Hieu Nguyen [mailto:hieu.t.ngu...@dektech.com.au] 
Sent: den 21 april 2017 09:27
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net; Hieu Thanh Nguyen 
<hieu.t.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Improve ccb error string handling [#2367]

---
 src/imm/immnd/ImmModel.cc | 61 +++
 1 file changed, 9 insertions(+), 52 deletions(-)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc index 
35c8a31..e337231 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -10734,6 +10734,12 @@ void ImmModel::setCcbErrorString(CcbInfo* ccb, const 
char* errorString,
   va_list args;
   int isValidationErrString = 0;
 
+  // Only store error strings on originating node where OM client resides.
+  if ((ccb->mAugCcbParent && !ccb->mAugCcbParent->mOriginatingConn) ||
+  (!ccb->mOriginatingConn)) {
+return;
+  }
+
   va_copy(args, vl);
   len = vsnprintf(fmtError, errLen, errorString, args);
   va_end(args);
@@ -11135,35 +11141,11 @@ void 
ImmModel::ccbObjDelContinuation(immsv_oi_ccb_upcall_rsp* rsp,
 // imm implementation has the right to veto any ccb at any time.
   }
 
-  if (rsp->errorString.size && ccb->mOriginatingConn) {
+  if (rsp->errorString.size) {
 /*Collect err strings, see: http://devel.opensaf.org/ticket/1904
   Only done at originating node since that is where the OM
   client resides. */
-unsigned int ix = 0;
-ImmsvAttrNameList* errStr = ccb->mErrorStrings;
-ImmsvAttrNameList** errStrTail = &(ccb->mErrorStrings);
-while (errStr) {
-  if (!strncmp(rsp->errorString.buf, errStr->name.buf,
-   rsp->errorString.size)) {
-TRACE_5("Discarding duplicate error string '%s' for ccb id %u",
-rsp->errorString.buf, ccbId);
-return;
-  }
-  ++ix;
-  errStrTail = &(errStr->next);
-  errStr = errStr->next;
-}
-
-if (ix >= IMMSV_MAX_ATTRIBUTES) {
-  TRACE_5("Discarding error string '%s' for ccb id %u (too many)",
-  rsp->errorString.buf, ccbId);
-} else {
-  (*errStrTail) = 
(ImmsvAttrNameList*)malloc(sizeof(ImmsvAttrNameList));
-  (*errStrTail)->next = NULL;
-  (*errStrTail)->name.size = rsp->errorString.size;
-  (*errStrTail)->name.buf = rsp->errorString.buf;
-  rsp->errorString.buf = NULL; /* steal */
-}
+setCcbErrorString(ccb, rsp->errorString.buf);
   }
 }
   }
@@ -11299,32 +11281,7 @@ void 
ImmModel::ccbCompletedContinuation(immsv_oi_ccb_upcall_rsp* rsp,
   if (rsp->errorString.size) {
 TRACE("Error string received.");
 /*Collect err strings, see: http://devel.opensaf.org/ticket/1904 */
-unsigned int ix = 0;
-ImmsvAttrNameList* errStr = ccb->mErrorStrings;
-ImmsvAttrNameList** errStrTail = &(ccb->mErrorStrings);
-while (errStr) {
-  if (!strncmp(rsp->errorString.buf, errStr->name.buf,
-   rsp->errorString.size)) {
-TRACE_5("Discarding duplicate error string '%s' for ccb id %u",
-rsp->errorString.buf, ccbId);
-return;
-  }
-  ++ix;
-  errStrTail = &(errStr->next);
-  errStr = errStr->next;
-}
-
-if (ix >= IMMSV_MAX_ATTRIBUTES) {
-  TRACE_5("Discarding error string '%s' for ccb id %u (too many)",
-  rsp->errorString.buf, ccbId);
-} else {
-  TRACE("Error string added.");
-  (*errStrTail) = 
(ImmsvAttrNameList*)malloc(sizeof(ImmsvAttrNameList));
-  (*errStrTail)->next = NULL;
-  (*errStrTail)->name.size = rsp->errorString.size;
-  (*errStrTail)->name.buf = rsp->errorString.buf;
-  rsp->errorString.buf = NULL; /* steal */
-}
+setCcbErrorString(ccb, rsp->errorString.buf);
   }
 }
   }
--
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] imm: Add more details to no dangling CcbErrorString [#2433]

2017-04-21 Thread Zoran Milinkovic
Hi Hung,

Reviewed the patch. Ack from me with a minor comment.

IMM CCB error strings are usually reported in format like "IMM: : ".
Please add error after "IMM: " before you push the code.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 21 april 2017 08:45
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Add more details to no dangling CcbErrorString [#2433]

Add more details to no dangling CcbErrorString.
---
 src/imm/immnd/ImmModel.cc | 50 +++
 1 file changed, 50 insertions(+)

diff --git a/src/imm/immnd/ImmModel.cc b/src/imm/immnd/ImmModel.cc
index 35c8a31..7afce0f 100644
--- a/src/imm/immnd/ImmModel.cc
+++ b/src/imm/immnd/ImmModel.cc
@@ -5401,6 +5401,9 @@ bool ImmModel::validateNoDanglingRefsModify(CcbInfo* ccb,
   LOG_NO(
   "ERR_FAILED_OPERATION: NO_DANGLING reference (%s) is 
dangling (Ccb %u)",
   av->getValueC_str(), ccb->mId);
+  setCcbErrorString(ccb,
+"IMM: Object %s has dangling reference (%s)",
+omit->first.c_str(), av->getValueC_str());
   TRACE_LEAVE();
   return false;
 }
@@ -5416,6 +5419,9 @@ bool ImmModel::validateNoDanglingRefsModify(CcbInfo* ccb,
 "ERR_FAILED_OPERATION: NO_DANGLING Reference (%s) "
 "refers to a non-persistent RTO (Ccb %u)",
 av->getValueC_str(), ccb->mId);
+setCcbErrorString(
+ccb, "IMM: Object %s refers to a non-persistent RTO (%s)",
+omit->first.c_str(), av->getValueC_str());
 TRACE_LEAVE();
 return false;
   }
@@ -5429,6 +5435,10 @@ bool ImmModel::validateNoDanglingRefsModify(CcbInfo* ccb,
 "refers to object flagged for delete by another Ccb: %u, 
(this Ccb %u)",
 av->getValueC_str(), omi->second->mCcbId, ccb->mId);
   }
+  setCcbErrorString(
+  ccb,
+  "IMM: Object %s refers to object flagged for deletion (%s)",
+  omit->first.c_str(), av->getValueC_str());
   TRACE_LEAVE();
   return false;
 }
@@ -5438,6 +5448,10 @@ bool ImmModel::validateNoDanglingRefsModify(CcbInfo* ccb,
   "ERR_FAILED_OPERATION: NO_DANGLING reference (%s) "
   "refers to object flagged for create by another CCB: %u, 
(this Ccb %u)",
   av->getValueC_str(), omi->second->mCcbId, ccb->mId);
+  setCcbErrorString(
+  ccb,
+  "IMM: Object %s refers to object flagged for creation in 
another CCB (%s)",
+  omit->first.c_str(), av->getValueC_str());
   TRACE_LEAVE();
   return false;
 }
@@ -5500,6 +5514,10 @@ bool ImmModel::validateNoDanglingRefsDelete(CcbInfo* ccb,
   "ERR_FAILED_OPERATION: Delete of object %s would violate NO_DANGLING 
reference "
   "from object %s, not scheduled for delete by this Ccb:%u",
   omit->first.c_str(), objName.c_str(), ccb->mId);
+  setCcbErrorString(ccb,
+"IMM: Object %s is currently reffered by object %s, "
+"not scheduled for deletion by this CCB",
+omit->first.c_str(), objName.c_str());
   rc = false;
   break;
 }
@@ -5510,6 +5528,10 @@ bool ImmModel::validateNoDanglingRefsDelete(CcbInfo* ccb,
   "ERR_FAILED_OPERATION: Delete of object %s would violate NO_DANGLING 
reference "
   "from object %s, scheduled for delete by another Ccb:%u (this 
Ccb:%u)",
   omit->first.c_str(), objName.c_str(), ommi->second->mCcbId, 
ccb->mId);
+  setCcbErrorString(ccb,
+"IMM: Object %s is currently reffered by object %s, "
+"scheduled for deletion by another CCB",
+omit->first.c_str(), objName.c_str());
   rc = false;
   break;
 }
@@ -8437,6 +8459,10 @@ SaAisErrorT ImmModel::ccbObjectCreate(
 "refers to a non persistent RTO %s (Ccb %u)",
 objectName.c_str(), i4->first.c_str(),
 attrVal->getValueC_str(), ccbId);
+setCcbErrorString(
+ccb,
+"IMM: Object %s re

Re: [devel] [PATCH 1/1] rde: save a role for active and standby nodes in peer info request [#2423]

2017-04-20 Thread Zoran Milinkovic
Hi Anders,

I'll add your comments when I push the code.

Thanks,
Zoran

-Original Message-
From: Anders Widell 
Sent: den 18 april 2017 16:06
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; ramesh.bet...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: Re: [devel] [PATCH 1/1] rde: save a role for active and standby nodes 
in peer info request [#2423]

Ack with comments:

1) Missing space between if statement and opening parenthesis.

2) Line line length exceeds 80 characters

3) The if statement should actually be removed - call SetPeerState() 
unconditionally here.

regards,

Anders Widell


On 04/11/2017 03:10 PM, Zoran Milinkovic wrote:
> When a node with active or standby role sends peer info request, the node 
> role will be saved.
> This will avoid setting the active role to the new starting node.
> ---
>   src/rde/rded/rde_main.cc | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/src/rde/rded/rde_main.cc b/src/rde/rded/rde_main.cc index 
> 977692c..aad9ba6 100644
> --- a/src/rde/rded/rde_main.cc
> +++ b/src/rde/rded/rde_main.cc
> @@ -103,6 +103,9 @@ static void handle_mbx_event() {
> LOG_NO("Got peer info request from node 0x%x with role %s",
>msg->fr_node_id, Role::to_string(msg->info.peer_info.ha_role));
> CheckForSplitBrain(msg);
> +  if(msg->info.peer_info.ha_role == PCS_RDA_ACTIVE || 
> msg->info.peer_info.ha_role == PCS_RDA_STANDBY) {
> +role->SetPeerState(msg->info.peer_info.ha_role, msg->fr_node_id);
> +  }
> SendPeerInfoResp(msg->fr_dest);
> break;
>   }


--
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 of 1] imm: Use waitpid with WNOHANG to check for sync process and pbe process [#2420]

2017-04-18 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 11 april 2017 14:08
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm: Use waitpid with WNOHANG to check for sync process 
and pbe process [#2420]

 src/imm/immnd/immnd_evt.c  |   7 ++-
 src/imm/immnd/immnd_proc.c |  25 +
 2 files changed, 27 insertions(+), 5 deletions(-)


Use waitpid with WNOHANG to check for sync process and pbe process.
The processes are checked before resending the intro message.
The intro message is only sent when those processes exit.

diff --git a/src/imm/immnd/immnd_evt.c b/src/imm/immnd/immnd_evt.c
--- a/src/imm/immnd/immnd_evt.c
+++ b/src/imm/immnd/immnd_evt.c
@@ -12232,8 +12232,6 @@ static uint32_t immnd_evt_proc_mds_evt(I
LOG_NO(
"Force kill sync process and abort 
sync");
kill(cb->syncPid, SIGKILL);
-   waitpid(cb->syncPid, NULL, 0);
-   cb->syncPid = 0;
 
cb->mState = IMM_SERVER_READY;
LOG_NO(
@@ -12293,13 +12291,12 @@ static uint32_t immnd_evt_proc_mds_evt(I
int status = 0;
if (waitpid(cb->pbePid, , WNOHANG) > 0) {
LOG_NO("PBE has terminated due to SC absence");
+   cb->pbePid = 0;
} else {
LOG_WA(
"SC were absent and PBE appears hung, 
sending SIGKILL");
kill(cb->pbePid, SIGKILL);
-   waitpid(cb->pbePid, NULL, 0);
-   }
-   cb->pbePid = 0;
+   }
}
 
} else if ((evt->info.mds_info.change == NCSMDS_UP) &&
diff --git a/src/imm/immnd/immnd_proc.c b/src/imm/immnd/immnd_proc.c
--- a/src/imm/immnd/immnd_proc.c
+++ b/src/imm/immnd/immnd_proc.c
@@ -493,6 +493,31 @@ uint32_t immnd_introduceMe(IMMND_CB *cb)
char *mdirDup = NULL;
memset(_evt, '\0', sizeof(IMMSV_EVT));
 
+   if (cb->mIntroduced == 2) {
+   /* Check for syncPid and pbePid, intro message will not be sent
+* until they all exit */
+   if (cb->syncPid > 0) {
+   int status = 0;
+   if (waitpid(cb->syncPid, , WNOHANG) > 0) {
+   cb->syncPid = 0;
+   } else {
+   LOG_WA("Sync process still doesn't exit, skip 
sending intro message");
+   rc = NCSCC_RC_FAILURE;
+   goto error;
+   }
+   }
+   if (cb->pbePid > 0) {
+   int status = 0;
+   if (waitpid(cb->pbePid, , WNOHANG) > 0) {
+   cb->pbePid = 0;
+   } else {
+   LOG_WA("PBE process still doesn't exit, skip 
sending intro message");
+   rc = NCSCC_RC_FAILURE;
+   goto error;
+   }
+   }
+   }
+
send_evt.type = IMMSV_EVT_TYPE_IMMD;
send_evt.info.immd.type = IMMD_EVT_ND2D_INTRO;
send_evt.info.immd.info.ctrl_msg.ndExecPid = cb->mMyPid;

--
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: Ignore the sync'ed IMMND nodes that are not up [#2418]

2017-04-18 Thread Zoran Milinkovic
Hi Hung,

Ack with a minor inline comment.


-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 13 april 2017 10:52
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Subject: [PATCH 1/1] imm: Ignore the sync'ed IMMND nodes that are not up [#2418]

Add new 'isUp' flag to IMMD_IMMND_INFO_NODE.
If a new IMMND node is added during MDS UP event or intro message,
the flag is set to true.
If a new IMMND node is added during coldsync, the flag is set to false.
The flag will be set to true when MDS UP event comes.
---
 src/imm/immd/immd_cb.h|  1 +
 src/imm/immd/immd_db.c| 34 +-
 src/imm/immd/immd_evt.c   |  2 ++
 src/imm/immd/immd_mbcsv.c |  5 +
 4 files changed, 29 insertions(+), 13 deletions(-)

diff --git a/src/imm/immd/immd_cb.h b/src/imm/immd/immd_cb.h
index af63a98..09a9c2c 100644
--- a/src/imm/immd/immd_cb.h
+++ b/src/imm/immd/immd_cb.h
@@ -59,6 +59,7 @@ typedef struct immd_immnd_info_node {
   bool isCoord;
   bool syncStarted;
   bool pbeConfigured; /* Pbe-file-name configured. Pbe may still be disabled. 
*/
+  bool isUp; /* True if received the MDS UP event */
 } IMMD_IMMND_INFO_NODE;
 
 typedef struct immd_immnd_detached_node { /* IMMD SBY tracking of departed
diff --git a/src/imm/immd/immd_db.c b/src/imm/immd/immd_db.c
index 7968b07..ec005d9 100644
--- a/src/imm/immd/immd_db.c
+++ b/src/imm/immd/immd_db.c
@@ -80,20 +80,28 @@ uint32_t immd_immnd_info_node_get(NCS_PATRICIA_TREE 
*immnd_tree, MDS_DEST *dest,
 void immd_immnd_info_node_getnext(NCS_PATRICIA_TREE *immnd_tree, MDS_DEST 
*dest,
  IMMD_IMMND_INFO_NODE **immnd_info_node)
 {
-   NODE_ID key;
-   memset(, 0, sizeof(NODE_ID));
-   /* Fill the Key */
-
-   if (dest) {
-   key = m_NCS_NODE_ID_FROM_MDS_DEST((*dest));
+   IMMD_IMMND_INFO_NODE* next_node = NULL;
+   MDS_DEST* current_dest = dest;
+   do {
+   if (current_dest) {
+   NODE_ID key;
+   memset(, 0, sizeof(NODE_ID));
+   key = m_NCS_NODE_ID_FROM_MDS_DEST((*current_dest));
+
+   next_node =
+   (IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
+   immnd_tree, (uint8_t *));
+   if (next_node) {
+   current_dest = _node->immnd_dest;
+   }

[Zoran] "if(next_node)..." block can be moved down.

+   } else {
+   next_node =
+   (IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
+   immnd_tree, (uint8_t *)NULL);
+   }

[Zoran] If the first node result is not NULL and "isUp" is false, the code will 
end up in an endless loop.
The "IF" block from upper comment can be moved here, and it will ensure that 
the iteration goes through the whole list of nodes in patricia tree.

This is a minor fix, and you don't need to send the patch for another review.

Thanks,
Zoran

+   } while (next_node && !next_node->isUp);
 
-   *immnd_info_node =
-   (IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
-   immnd_tree, (uint8_t *));
-   } else
-   *immnd_info_node =
-   (IMMD_IMMND_INFO_NODE *)ncs_patricia_tree_getnext(
-   immnd_tree, (uint8_t *)NULL);
+   *immnd_info_node = next_node;
 
return;
 }
diff --git a/src/imm/immd/immd_evt.c b/src/imm/immd/immd_evt.c
index 49ac7c3..c1371fc 100644
--- a/src/imm/immd/immd_evt.c
+++ b/src/imm/immd/immd_evt.c
@@ -1054,6 +1054,8 @@ static IMMD_IMMND_INFO_NODE *immd_add_immnd_node(IMMD_CB 
*cb, MDS_DEST dest)
return NULL;
}
 
+   node_info->isUp = true;
+
if (add_flag) {
TRACE("IMMND node has already been added, dest %" PRIu64, dest);
}
diff --git a/src/imm/immd/immd_mbcsv.c b/src/imm/immd/immd_mbcsv.c
index 8ccadd1..bed2c28 100644
--- a/src/imm/immd/immd_mbcsv.c
+++ b/src/imm/immd/immd_mbcsv.c
@@ -1243,6 +1243,11 @@ static uint32_t mbcsv_dec_sync_resp(IMMD_CB *cb, 
NCS_MBCSV_CB_ARG *arg)
immd_immnd_info_node_find_add(>immnd_tree, ,
  _info, _flag);
osafassert(node_info);
+   if (!add_flag) {
+   /* New node is added to the list,
+* MDS UP event is not received */
+   node_info->isUp = false;
+   }
 
ptr = ncs_dec_flatten_space(>info.decode.i_uba, data,
sizeof(uint32_t));
-- 
1.9.1


--

Re: [devel] [PATCH 1 of 1] cpd: to correct failover behavior of cpsv [#1765] V5

2017-04-18 Thread Zoran Milinkovic
Hi Hoang,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Vo Minh Hoang [mailto:hoang.m...@dektech.com.au] 
Sent: den 14 april 2017 10:44
To: 'A V Mahesh' <mahesh.va...@oracle.com>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net; 'Ramesh Babu Betham' 
<ramesh.bet...@oracle.com>
Subject: RE: [PATCH 1 of 1] cpd: to correct failover behavior of cpsv [#1765] V5

Dear Mahesh,

Thank you for your comments.
I add 2 of my ideals inline, please find [Hoang] tags.

Dear Zoran,

Do you have any extra comment about this patch?
If not, I will request pushing it at start of next week.

Sincerely,
Hoang

-Original Message-
From: A V Mahesh [mailto:mahesh.va...@oracle.com]
Sent: Thursday, April 13, 2017 5:47 PM
To: Vo Minh Hoang <hoang.m...@dektech.com.au>; zoran.milinko...@ericsson.com
Cc: opensaf-devel@lists.sourceforge.net; Ramesh Babu Betham 
<ramesh.bet...@oracle.com>
Subject: Re: [PATCH 1 of 1] cpd: to correct failover behavior of cpsv [#1765] V5

Hi Hoang,

ACK with following : ( tested basic ND restarts)

- The below errors are not related this patch, those are test case related

- It look their a existing issue ( not related to this patch ) on Cpnd down the 
 STANDBY Cpd is
   also starting `cpd_tmr_start(_info->cpnd_ret_timer,..);`  please check 
that flow once
   (after cpnd restart keep some sleep Actvie CPD and do a switch over )
[Hoang]: I also can reproduce this behavior but could not find error.
So I will continue checking it in separate ticket.
It is a little bit weird that standby cpd trigger something. Honestly I think 
standby should do data sync only. Btw, that is too soon to talk about this case.

-  You introduced cpd_tmr_stop(_info->cpnd_ret_timer);  in
cpnd_down_process()
but cpnd_up_process()  do call
`cpd_tmr_stop(_info->cpnd_ret_timer);`
do check that it may be redundant call .
[Hoang]: I thought we should keep this call even it is redundant in this case. 
We are detecting more and more unexpected error cases in system and cannot tell 
for sure it is redundant or not.

-AVM

On 4/12/2017 2:19 PM, A V Mahesh wrote:
> Hi Hoang,
>
> On 2/10/2017 3:09 PM, Vo Minh Hoang wrote:
>> If cpnd is temporary down only, we don't need clean up anything.
>> If cpnd is permanently down, the bad effect of this proposal is that 
>> replica is not clean up. But if cpnd permanently down, we have to 
>> reboot node for recovering so I think this cleanup is not really 
>> necessary.
>>
>> I also checked this implementation with possible test cases and have 
>> not seen any side effect.
>> Please consider it
> We are observing new node_user_info  databases mismatch Errors, while 
> testing multiple CPND restart with this patch,I will do more debugging 
> and update the root cause.
>
> ==
> =
>
>
> Apr 12 14:06:57 SC-1 osafckptd[27594]: NO cpnd_down_process:: Start 
> CPND_RETENTION timer id = 0x7f86f0500cf0, arg=0x7f86f0501ef0 *Apr 12
> 14:06:58 SC-1 osafckptd[27594]: ER cpd_proc_decrease_node_user_info 
> failed - no user on node id 0x2020F* Apr 12 14:06:58 SC-1
> osafckptd[27594]: NO cpnd_down_process:: Start CPND_RETENTION timer id 
> = 0x7f86f0501750, arg=0x7f86f0501ef0 *Apr 12 14:06:59 SC-1
> osafckptd[27594]: ER cpd_proc_decrease_node_user_info failed - no user 
> on node id 0x2020F* Apr 12 14:06:59 SC-1 osafckptd[27594]: NO
> cpnd_down_process:: Start CPND_RETENTION timer id = 0x7f86f0503ab0,
> arg=0x7f86f0501ef0 Apr 12 14:07:00 SC-1 osafckptd[27594]: NO
> cpnd_down_process:: Start CPND_RETENTION timer id = 0x7f86f0500c70,
> arg=0x7f86f0501ef0 Apr 12 14:07:01 SC-1 osafckptd[27594]: NO
> cpnd_down_process:: Start CPND_RETENTION timer id = 0x7f86f0500930,
> arg=0x7f86f0501ef0 *Apr 12 14:07:03 SC-1 osafckptd[27594]: ER 
> cpd_proc_decrease_node_user_info failed - no user on node id 0x2020*F 
> Apr 12 14:07:03 SC-1 osafckptd[27594]: NO cpnd_down_process:: Start 
> CPND_RETENTION timer id = 0x7f86f04fe3a0, arg=0x7f86f0501ef0 Apr 12
> 14:07:04 SC-1 osafckptd[27594]: NO cpnd_down_process:: Start 
> CPND_RETENTION timer id = 0x7f86f0500cf0, arg=0x7f86f0501ef0
>
> ==
> =
>
>
> -AVM
>
>
> On 4/12/2017 11:08 AM, A V Mahesh wrote:
>> Hi Hoang,
>>
>> On 2/10/2017 3:09 PM, Vo Minh Hoang wrote:
>>> Dear Mahesh,
>>>
>>> Based on what I saw, in this case, retention time cannot detect CPND 
>>> temporarily down because its pid changed.
>> I will check that , I have some test cases based this retention time 
>> , not sure how were they working.
&

[devel] [PATCH 0/1] Review Request for rde: save a role for active and standby nodes in peer info request [#2423]

2017-04-11 Thread Zoran Milinkovic
Summary: rde: save a role for active and standby nodes in peer info request 
[#2423]
Review request for Ticket(s): 2423
Peer Reviewer(s): Anders W., Ramesh
Pull request to: Zoran
Affected branch(es): develop
Development branch: ticket-2423
Private 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 servicesn
 OpenSAF servicesy
 Core libraries  n
 Samples n
 Tests   n
 Other   n


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

revision 0ba8847949ad2ea3517e782c5c277bf37b14af24
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Tue, 11 Apr 2017 14:49:09 +0200

rde: save a role for active and standby nodes in peer info request [#2423]

When a node with active or standby role sends peer info request, the node role 
will be saved.
This will avoid setting the active role to the new starting node.



Complete diffstat:
--
 src/rde/rded/rde_main.cc | 3 +++
 1 file changed, 3 insertions(+)


Testing Commands:
-


Testing, Expected Results:
--
The problem is very hard to reproduce. That's because it's a timing issue in 
very small time gap.
When a new joined node receives peer info request from a active or standby 
node, and before the joined node received response from active or standby node, 
the joined node should not set active or standby role.


Conditions of Submission:
-
Ack from Anders W. and Ramesh


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] rde: save a role for active and standby nodes in peer info request [#2423]

2017-04-11 Thread Zoran Milinkovic
When a node with active or standby role sends peer info request, the node role 
will be saved.
This will avoid setting the active role to the new starting node.
---
 src/rde/rded/rde_main.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/rde/rded/rde_main.cc b/src/rde/rded/rde_main.cc
index 977692c..aad9ba6 100644
--- a/src/rde/rded/rde_main.cc
+++ b/src/rde/rded/rde_main.cc
@@ -103,6 +103,9 @@ static void handle_mbx_event() {
   LOG_NO("Got peer info request from node 0x%x with role %s",
  msg->fr_node_id, Role::to_string(msg->info.peer_info.ha_role));
   CheckForSplitBrain(msg);
+  if(msg->info.peer_info.ha_role == PCS_RDA_ACTIVE || 
msg->info.peer_info.ha_role == PCS_RDA_STANDBY) {
+role->SetPeerState(msg->info.peer_info.ha_role, msg->fr_node_id);
+  }
   SendPeerInfoResp(msg->fr_dest);
   break;
 }
-- 
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


Re: [devel] [PATCH 1 of 1] imm: Check if response is NULL when sending MDS sync message [#2401]

2017-04-11 Thread Zoran Milinkovic
Hi Hung,

Ack from me.

Thanks,
Zoran

-Original Message-
From: Hung Nguyen [mailto:hung.d.ngu...@dektech.com.au] 
Sent: den 4 april 2017 09:10
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm: Check if response is NULL when sending MDS sync 
message [#2401]

 src/imm/agent/imma_mds.cc |  6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)


Check if response is NULL when sending MDS sync message.

diff --git a/src/imm/agent/imma_mds.cc b/src/imm/agent/imma_mds.cc
--- a/src/imm/agent/imma_mds.cc
+++ b/src/imm/agent/imma_mds.cc
@@ -602,8 +602,12 @@ uint32_t imma_mds_msg_sync_send(uint32_t
/* send the message */
rc = ncsmds_api(_info);
 
-   if (rc == NCSCC_RC_SUCCESS)
+   if (rc == NCSCC_RC_SUCCESS) {
*o_evt = (IMMSV_EVT *) mds_info.info.svc_send.info.sndrsp.o_rsp;
+   if (*o_evt == NULL) {
+   rc = NCSCC_RC_FAILURE;
+   }
+   }
 
return rc;
 }

--
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 of 1] immm: Fixed memory leak in imm_cfg.c file [#2408]

2017-04-11 Thread Zoran Milinkovic
Hi Hieu,

Fix indentation. In C files, we use TAB instead of spaces.
Ack from me.

Thanks,
Zoran

-Original Message-
From: Hieu Nguyen [mailto:hieu.t.ngu...@dektech.com.au] 
Sent: den 3 april 2017 07:26
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; 
reddy.neelaka...@oracle.com; Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] immm: Fixed memory leak in imm_cfg.c file [#2408]

 src/imm/tools/imm_cfg.c |  10 +++---
 1 files changed, 7 insertions(+), 3 deletions(-)


Fixed memory leak in unique_admiOwner() function of imm_cfg.c file

diff --git a/src/imm/tools/imm_cfg.c b/src/imm/tools/imm_cfg.c
--- a/src/imm/tools/imm_cfg.c
+++ b/src/imm/tools/imm_cfg.c
@@ -857,10 +857,14 @@ static char *create_adminOwnerName(char 
 
if (gethostname(hostname, sizeof(hostname)) != 0){
fprintf(stderr, "error while retrieving hostname\n");
-   if(transaction_mode)
-   return NULL;
-   else
+   if(transaction_mode) {
+if(unique_adminOwner)
+free(unique_adminOwner);
+return NULL;
+}
+   else {
exit(EXIT_FAILURE);
+}
}
sprintf(unique_adminOwner, "%s_%s_%d", base, hostname, getpid());
return unique_adminOwner;

--
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 of 1] imm :decrement the pending reply when error is other than SA_AIS_OK when newCcbId is called [#2386] V2

2017-03-22 Thread Zoran Milinkovic
Hi Neelakanta,

Reviewed the patch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 21 mars 2017 12:15
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm :decrement the pending reply when error is other 
than SA_AIS_OK when newCcbId is called [#2386] V2

 src/imm/agent/imma_om_api.cc |  8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)


diff --git a/src/imm/agent/imma_om_api.cc b/src/imm/agent/imma_om_api.cc
--- a/src/imm/agent/imma_om_api.cc
+++ b/src/imm/agent/imma_om_api.cc
@@ -1528,7 +1528,6 @@ SaAisErrorT saImmOmCcbInitialize(SaImmAd
 
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node=NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -1554,6 +1553,7 @@ SaAisErrorT saImmOmCcbInitialize(SaImmAd
} 
 
imma_proc_decrement_pending_reply(cl_node, true);
+   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
 
if (cl_node->stale) {
if (isExposed(cb, cl_node)) {
@@ -1817,7 +1817,6 @@ static SaAisErrorT ccb_object_create_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -2412,7 +2411,6 @@ static SaAisErrorT ccb_object_modify_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -2895,7 +2893,6 @@ static SaAisErrorT ccb_object_delete_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -6521,7 +6518,6 @@ SaAisErrorT saImmOmCcbObjectRead(SaImmCc
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -9191,7 +9187,6 @@ static SaAisErrorT imma_finalizeCcb(SaIm
 
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node=NULL;
-   if(rc != SA_AIS_OK) {goto done;}
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -9212,6 +9207,7 @@ static SaAisErrorT imma_finalizeCcb(SaIm
/* Dont care if cl_node is stale here. This will be 
caught
   in the next attempt to use the related handle(s).
 */
+   if(rc != SA_AIS_OK) {goto done;}
}
}
  

--
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 of 1] imm :decrement the pending reply when error is other than SA_AIS_OK when newCcbId is called [#2386]

2017-03-20 Thread Zoran Milinkovic
Hi Neelakanta,

cl_node is always NULL when imma_proc_decrement_pending_reply() is called.
It may crash IMM client in imma_proc_decrement_pending_reply() function.

Thanks,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 17 mars 2017 10:29
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm :decrement the pending reply when error is other 
than SA_AIS_OK when newCcbId is called [#2386]

 src/imm/agent/imma_om_api.cc |  25 -
 1 files changed, 20 insertions(+), 5 deletions(-)


diff --git a/src/imm/agent/imma_om_api.cc b/src/imm/agent/imma_om_api.cc
--- a/src/imm/agent/imma_om_api.cc
+++ b/src/imm/agent/imma_om_api.cc
@@ -1817,7 +1817,10 @@ static SaAisErrorT ccb_object_create_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
+   if(rc == SA_AIS_ERR_LIBRARY) {
+   imma_proc_decrement_pending_reply(cl_node, true);
+   goto done;
+   }
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -2412,7 +2415,10 @@ static SaAisErrorT ccb_object_modify_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
+   if(rc == SA_AIS_ERR_LIBRARY) {
+   imma_proc_decrement_pending_reply(cl_node, true);
+   goto done;
+   }
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -2895,7 +2901,10 @@ static SaAisErrorT ccb_object_delete_com
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
+   if(rc == SA_AIS_ERR_LIBRARY) {
+   imma_proc_decrement_pending_reply(cl_node, true);
+   goto done;
+   }
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -6521,7 +6530,10 @@ SaAisErrorT saImmOmCcbObjectRead(SaImmCc
}
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node = NULL;
-   if(rc == SA_AIS_ERR_LIBRARY) {goto done;}
+   if(rc == SA_AIS_ERR_LIBRARY) {
+   imma_proc_decrement_pending_reply(cl_node, true);
+   goto done;
+   }
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));
@@ -9191,7 +9203,10 @@ static SaAisErrorT imma_finalizeCcb(SaIm
 
rc = imma_newCcbId(cb, ccb_node, adminOwnerId, , 
cl_node->syncr_timeout);
cl_node=NULL;
-   if(rc != SA_AIS_OK) {goto done;}
+   if(rc != SA_AIS_OK) {
+   imma_proc_decrement_pending_reply(cl_node, 
true);
+   goto done;
+   }
/* ccb_node still valid if rc == SA_AIS_OK. */
if(rc == SA_AIS_OK) {
osafassert(!(ccb_node->mExclusive));

--
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 of 1] imm: return ERR_UNAVAILABLE when CLM node is locked, for OiObjectimplementerSet/Release[#2373]

2017-03-20 Thread Zoran Milinkovic
Hi Neelakanta,

Reviewed the patch.
Ack from me.

Thanks,
Zoran

-Original Message-
From: reddy.neelaka...@oracle.com [mailto:reddy.neelaka...@oracle.com] 
Sent: den 20 mars 2017 10:36
To: Hung Duc Nguyen <hung.d.ngu...@dektech.com.au>; Zoran Milinkovic 
<zoran.milinko...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm: return ERR_UNAVAILABLE when CLM node is locked, 
for OiObjectimplementerSet/Release[#2373]

 src/imm/agent/imma_oi_api.cc |  14 ++
 1 files changed, 14 insertions(+), 0 deletions(-)


diff --git a/src/imm/agent/imma_oi_api.cc b/src/imm/agent/imma_oi_api.cc
--- a/src/imm/agent/imma_oi_api.cc
+++ b/src/imm/agent/imma_oi_api.cc
@@ -2120,6 +2120,12 @@ static SaAisErrorT object_implementer_se
goto bad_handle;
}
 
+   if(cl_node->isImmA2x12 && cl_node->clmExposed){
+   TRACE_2("SA_AIS_ERR_UNAVAILABLE: imma CLM node left the 
cluster");
+   rc = SA_AIS_ERR_UNAVAILABLE;
+   goto clm_left;
+   }
+
if (cl_node->stale) {
TRACE_1("Handle %llx is stale", immOiHandle);
bool resurrected = imma_oi_resurrect(cb, cl_node, , 
); @@ -2216,6 +,7 @@ static SaAisErrorT object_implementer_se
osafassert(out_evt->info.imma.type == IMMA_EVT_ND2A_IMM_ERROR);
rc = out_evt->info.imma.info.errRsp.error;
 
+ clm_left:
  fevs_error:
  bad_handle:
if (locked)
@@ -2339,6 +2346,12 @@ static SaAisErrorT object_implementer_re
goto bad_handle;
}
 
+   if(cl_node->isImmA2x12 && cl_node->clmExposed){
+   TRACE_2("SA_AIS_ERR_UNAVAILABLE: imma CLM node left the 
cluster");
+   rc = SA_AIS_ERR_UNAVAILABLE;
+   goto clm_left;
+   }
+
if (cl_node->stale) {
TRACE_1("Handle %llx is stale", immOiHandle);
bool resurrected = imma_oi_resurrect(cb, cl_node, , 
); @@ -2433,6 +2446,7 @@ static SaAisErrorT object_implementer_re
osafassert(out_evt->info.imma.type == IMMA_EVT_ND2A_IMM_ERROR);
rc = out_evt->info.imma.info.errRsp.error;
 
+ clm_left:
  fevs_error:
  bad_handle:
if (locked)

--
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 0 of 2] Review Request for mdstest: handle memory leak [#1860]

2017-03-08 Thread Zoran Milinkovic
Hi Vo,

I don't see that #2174 has been pushed. Did you mean some other patch ?
Anyway, I tested again on the latest changeset on default branch and the memory 
leak is still there + one more.

All 3 memory leaks might be due to failed MDS tests.

You have ack to the current patch, and for these three memory leaks we can open 
a new ticket.

I run next command:
valgrind --leak-check=full mdstest

Result from today's MDS test on the default branch:
   Test Result:
  Total:  185
  Passed: 183
  Failed: 2

Reported memory leaks:
==21333== 752 bytes in 2 blocks are definitely lost in loss record 10 of 13
==21333==at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21333==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==21333==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==21333==by 0x4E95C14: mdtm_process_discovery_events (mds_dt_tipc.c:1031)
==21333==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==21333==by 0x50C7183: start_thread (pthread_create.c:312)
==21333==by 0x53D737C: clone (clone.S:111)
==21333== 
==21333== 8,448 (376 direct, 8,072 indirect) bytes in 1 blocks are definitely 
lost in loss record 12 of 13
==21333==at 0x4C2AB80: malloc (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==21333==by 0x4E7FCBE: mds_mcm_mailbox_post (mds_c_sndrcv.c:4866)
==21333==by 0x4E7FCBE: mds_mcm_process_recv_snd_msg_common 
(mds_c_sndrcv.c:4246)
==21333==by 0x4E82532: mcm_recv_red_bcast (mds_c_sndrcv.c:4467)
==21333==by 0x4E82532: mds_mcm_ll_data_rcv (mds_c_sndrcv.c:4148)
==21333==by 0x4E8A57E: mdtm_process_recv_message_common 
(mds_dt_common.c:504)
==21333==by 0x4E8AB5D: mdtm_process_recv_data (mds_dt_common.c:948)
==21333==by 0x4E951B5: mdtm_process_recv_events (mds_dt_tipc.c:819)
==21333==by 0x50C7183: start_thread (pthread_create.c:312)
==21333==by 0x53D737C: clone (clone.S:111)
==21333== 
==21333== LEAK SUMMARY:
==21333==definitely lost: 1,128 bytes in 3 blocks
==21333==indirectly lost: 8,072 bytes in 2 blocks
==21333==  possibly lost: 120 bytes in 4 blocks
==21333==still reachable: 263,815 bytes in 5 blocks
==21333== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran

-Original Message-
From: Vo Minh Hoang [mailto:hoang.m...@dektech.com.au] 
Sent: den 8 mars 2017 05:49
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; mahesh.va...@oracle.com; 
Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory 
leak [#1860]

Dear Zoran,

Thank you very much for your checking.

Would you please tell me which test case is failed in your environment because 
my current pc return OK for all and no mem leak. That might because of 
threading problem.

Further information, please note that this patch should apply after #2174 
(already been pushed).

Sincerely,
Hoang

-Original Message-
From: Zoran Milinkovic [mailto:zoran.milinko...@ericsson.com]
Sent: Tuesday, March 7, 2017 10:07 PM
To: Hoang Minh Vo <hoang.m...@dektech.com.au>; mahesh.va...@oracle.com; Anders 
Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory 
leak [#1860]

Hi Hoang,

Reviewed and tested both patches.

There is still a memory leak when some tests fail.

==20325== 752 bytes in 2 blocks are definitely lost in loss record 9 of 10
==20325==at 0x4C2AB80: malloc (in
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==20325==by 0x4E7731D: mds_mcm_user_event_callback (mds_c_api.c:3301)
==20325==by 0x4E78BB1: mds_mcm_svc_up (mds_c_api.c:1615)
==20325==by 0x4E95C14: mdtm_process_discovery_events
(mds_dt_tipc.c:1031)
==20325==by 0x4E95C14: mdtm_process_recv_events (mds_dt_tipc.c:699)
==20325==by 0x50C7183: start_thread (pthread_create.c:312)
==20325==by 0x53D737C: clone (clone.S:111)
==20325==
==20325== LEAK SUMMARY:
==20325==definitely lost: 752 bytes in 2 blocks
==20325==indirectly lost: 0 bytes in 0 blocks
==20325==  possibly lost: 120 bytes in 4 blocks
==20325==still reachable: 263,815 bytes in 5 blocks
==20325== suppressed: 0 bytes in 0 blocks

Thanks,
Zoran


-Original Message-
From: Hoang Vo [mailto:hoang.m...@dektech.com.au]
Sent: den 6 mars 2017 09:00
To: mahesh.va...@oracle.com; Anders Widell <anders.wid...@ericsson.com>
Cc: opensaf-devel@lists.sourceforge.net
Subject: [devel] [PATCH 0 of 2] Review Request for mdstest: handle memory leak 
[#1860]

Summary: mdstest: handle memory leak [#1860] Review request for Trac
Ticket(s): #1870 Peer Reviewer(s): mahesh.va...@oracle.com; 
zoran.milinko...@ericsson.com Pull request to: mahesh.va...@oracle.com Affected 
branch(es): default Development branch: default


Impacted area   Impact y/n

Re: [devel] [PATCH 1 of 1] imm: Fix all Cppcheck 1.77 issues [#2333]

2017-03-08 Thread Zoran Milinkovic
Hi Mahesh,

Reviewed and tested the patch.
The patch silently fix IMMA UP bug.

Ack from me.

Thanks,
Zoran

-Original Message-
From: mahesh.va...@oracle.com [mailto:mahesh.va...@oracle.com] 
Sent: den 3 mars 2017 06:42
To: Zoran Milinkovic <zoran.milinko...@ericsson.com>; Hung Duc Nguyen 
<hung.d.ngu...@dektech.com.au>; reddy.neelaka...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Subject: [PATCH 1 of 1] imm: Fix all Cppcheck 1.77 issues [#2333]

 src/imm/agent/imma_db.cc |   8 +---
 src/imm/agent/imma_mds.cc|   6 +--
 src/imm/agent/imma_oi_api.cc |   3 +-
 src/imm/agent/imma_om_api.cc |  19 +
 src/imm/agent/imma_proc.cc   |  12 ++
 src/imm/immd/immd_db.c   |   9 +---
 src/imm/immd/immd_evt.c  |  29 ++-
 src/imm/immd/immd_mbcsv.c|   9 +---
 src/imm/immd/immd_mds.c  |  17 ++--
 src/imm/immnd/ImmModel.cc|  80 ---
 src/imm/immnd/immnd_clm.c|   4 +-
 src/imm/immnd/immnd_db.c |   7 +--
 src/imm/immnd/immnd_evt.c|  29 +--
 src/imm/immnd/immnd_main.c   |   4 +-
 src/imm/immnd/immnd_mds.c|  10 +---
 src/imm/immnd/immnd_proc.c   |   7 +--
 16 files changed, 98 insertions(+), 155 deletions(-)


Except never used functions all other issues are fixed  of below,
some UN-pushed enhancement may be using those functions.

[staging/src/imm/immnd/ImmModel.cc:2985] -> 
[staging/src/imm/immnd/ImmModel.cc:3002]: (warning) Either the condition 
'increment&' is redundant or there is possible null pointer 
dereference: immObject.
[staging/src/imm/immnd/ImmModel.cc:2986] -> 
[staging/src/imm/immnd/ImmModel.cc:3002]: (warning) Either the condition 
'increment&' is redundant or there is possible null pointer 
dereference: immObject.
[staging/src/imm/immnd/ImmModel.cc:10798]: (style) C-style pointer casting
[staging/src/imm/immnd/ImmModel.cc:11027]: (style) C-style pointer casting
[staging/src/imm/immnd/ImmModel.cc:12510]: (style) C-style pointer casting
[staging/src/imm/immnd/ImmModel.cc:13921]: (style) C-style pointer casting
[staging/src/imm/immnd/ImmModel.cc:2980] -> 
[staging/src/imm/immnd/ImmModel.cc:2984]: (style) Variable 'immObject' is 
reassigned a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:7141] -> 
[staging/src/imm/immnd/ImmModel.cc:7154]: (style) Variable 'current' is 
reassigned a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:7445] -> 
[staging/src/imm/immnd/ImmModel.cc:7455]: (style) Variable 'ccb' is reassigned 
a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:7448] -> 
[staging/src/imm/immnd/ImmModel.cc:7460]: (style) Variable 'oMut' is reassigned 
a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:7541] -> 
[staging/src/imm/immnd/ImmModel.cc:7550]: (style) Variable 'afim' is reassigned 
a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:7579] -> 
[staging/src/imm/immnd/ImmModel.cc:7589]: (style) Variable 'afim' is reassigned 
a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:14144] -> 
[staging/src/imm/immnd/ImmModel.cc:14148]: (style) Variable 'immObject' is 
reassigned a value before the old one has been used.
[staging/src/imm/immnd/ImmModel.cc:673]: (style) The scope of the variable 'ix' 
can be reduced.
[staging/src/imm/immnd/ImmModel.cc:905]: (style) The scope of the variable 'ix' 
can be reduced.
[staging/src/imm/immnd/ImmModel.cc:931]: (style) The scope of the variable 'ix' 
can be reduced.
[staging/src/imm/immnd/ImmModel.cc:1041]: (style) The scope of the variable 
'ix' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:1074]: (style) The scope of the variable 
'ix' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:1882]: (style) The scope of the variable 
'ix' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:2031]: (style) The scope of the variable 
'ix' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:5462]: (style) The scope of the variable 
'ai' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:16545]: (style) The scope of the variable 
'sendCompletedToSlave' can be reduced.
[staging/src/imm/immnd/ImmModel.cc:19363]: (style) Unused variable: i3
[staging/src/imm/immnd/ImmModel.cc:104]: (style) Struct 
'ImplementerCcbAssociation' has a constructor with 1 argument that is not 
explicit.
[staging/src/imm/immnd/ImmModel.cc:118]: (style) Struct 'ClassInfo' has a 
constructor with 1 argument that is not explicit.
[staging/src/imm/immnd/ImmModel.cc:269]: (style) Struct 'ObjectMutation' has a 
constructor with 1 argument that is not explicit.
[staging/src/imm/immnd/ImmModel.cc:576]: (style) Struct 'AttrFlagIncludes' has 
a constructor with 1 argument that is not explicit.
[staging/src/imm/immnd/ImmModel.cc:587]: (style) Struct 'IdIs' has a 
constructor with 1 argument that is not explicit.
[staging/src/imm/immnd/ImmModel.cc:598]: (style) Stru

[devel] [PATCH 1 of 1] imm: fix log level for saClmDispatch [#2353]

2017-03-07 Thread Zoran Milinkovic
 src/imm/immnd/immnd_main.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


If saClmDispatch fails with SA_AIS_ERR_BAD_HANDLE error, the message will be 
logged with warning level and CLM handle will be reinitialized.
All other saClmDispatch errors will be logged with error level.

diff --git a/src/imm/immnd/immnd_main.c b/src/imm/immnd/immnd_main.c
--- a/src/imm/immnd/immnd_main.c
+++ b/src/imm/immnd/immnd_main.c
@@ -407,14 +407,15 @@ int main(int argc, char *argv[])
 
if (fds[FD_CLM].revents & POLLIN) {
if ((error = saClmDispatch(immnd_cb->clm_hdl, 
SA_DISPATCH_ALL)) != SA_AIS_OK) {
-   LOG_ER("saClmDispatch failed: %u", 
error);
if(error == SA_AIS_ERR_BAD_HANDLE){
+   LOG_WA("saClmDispatch failed: 
%u", error);
LOG_NO("Re-initializing with 
CLMS");

saClmFinalize(immnd_cb->clm_hdl);

immnd_clm_node_cleanup(immnd_cb);
immnd_cb->clmSelectionObject = 
-1;
immnd_init_with_clm();
} else {
+   LOG_ER("saClmDispatch failed: 
%u", error);
break;
}
}

--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


[devel] [PATCH 0 of 1] Review Request for imm: fix log level for saClmDispatch [#2353]

2017-03-07 Thread Zoran Milinkovic
Summary: imm: fix log level for saClmDispatch [#2353]
Review request for Trac Ticket(s): 2353
Peer Reviewer(s): Neelakanta, Hung
Pull request to: Zoran
Affected branch(es): opensaf-5.2.x, default(5.3)
Development branch: default(5.3)


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 7174f12861a545a4cbb542d9834e9976f7840493
Author: Zoran Milinkovic <zoran.milinko...@ericsson.com>
Date:   Tue, 07 Mar 2017 17:02:07 +0100

imm: fix log level for saClmDispatch [#2353]

If saClmDispatch fails with SA_AIS_ERR_BAD_HANDLE error, the message 
will be
logged with warning level and CLM handle will be reinitialized. All 
other
saClmDispatch errors will be logged with error level.


Complete diffstat:
--
 src/imm/immnd/immnd_main.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


Testing Commands:
-


Testing, Expected Results:
--
Check that the logging is correct


Conditions of Submission:
-
Ack from Neelakanta and Hung


Arch  Built StartedLinux distro
---
mipsn  n
mips64  n  n
x86 n  n
x86_64  n  n
powerpc n  n
powerpc64   n  n


Reviewer Checklist:
---
[Submitters: make sure that your review doesn't trigger any checkmarks!]


Your checkin has not passed review because (see checked entries):

___ Your RR template is generally incomplete; it has too many blank entries
that need proper data filled in.

___ You have failed to nominate the proper persons for review and push.

___ Your patches do not have proper short+long header

___ You have grammar/spelling in your header that is unacceptable.

___ You have exceeded a sensible line length in your headers/comments/text.

___ You have failed to put in a proper Trac Ticket # into your commits.

___ You have incorrectly put/left internal data in your comments/files
(i.e. internal bug tracking tool IDs, product names etc)

___ You have not given any evidence of testing beyond basic build tests.
Demonstrate some level of runtime or other sanity testing.

___ You have ^M present in some of your files. These have to be removed.

___ You have needlessly changed whitespace or added whitespace crimes
like trailing spaces, or spaces before tabs.

___ You have mixed real technical changes with whitespace and other
cosmetic code cleanup changes. These have to be separate commits.

___ You need to refactor your submission into logical chunks; there is
too much content into a single commit.

___ You have extraneous garbage in your review (merge commits etc)

___ You have giant attachments which should never have been sent;
Instead you should place your content in a public tree to be pulled.

___ You have too many commits attached to an e-mail; resend as threaded
commits, or place in a public tree for a pull.

___ You have resent this content multiple times without a clear indication
of what has changed between each re-send.

___ You have failed to adequately and individually address all of the
comments and change requests that were proposed in the initial review.

___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)

___ Your computer have a badly configured date and time; confusing the
the threaded patch review.

___ Your changes affect IPC mechanism, and you don't present any results
for in-service upgradability test.

___ Your changes affect user manual and documentation, your patch series
do not contain the patch that updates the Doxygen manual.


--
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


  1   2   3   4   5   6   7   >