Re: [devel] [PATCH 1 of 1] amfd: allow lock and unlock operation on NoRed MW SI. [#1834]

2016-07-04 Thread praveen malviya
Hi,

Please provide your feedback on this patch.
I would like to push this patch by tomorrow.

Thanks,
Praveen

On 24-Jun-16 11:06 AM, praveen.malv...@oracle.com wrote:
>  osaf/services/saf/amf/amfd/si.cc |  20 +++-
>  1 files changed, 19 insertions(+), 1 deletions(-)
>
>
> In the reported issue, amfd crashes during deletion of MW NoRed SI while
> standby SC is coming up.
>
> Here requirement is to bring down a payload node and delete its related 
> configuration
> like node, MW SI, MW SU etc. As per AMF PR doc section 7.1.4 , SI must be 
> locked before
> deleting it. Also AMF allows deletion of SI in unlocked state if it is 
> unassigned, but
> it is not the recommended way. Since lock operation on NoRed MW SI is not 
> allowed,
> the only way to delete is when it is unassigned. This imposes another 
> criterion to bring
> down the node or lock NoRed SU so that its MW SI gets unassigned and its 
> deletion can proceed.
> Even in this case also, AMF can pick the same SI and assign it to some other 
> unassigned node
> or any node joining the cluster that time. Thus there is no gaurantee that SI 
> will remain
> unassigned.
>
> Patch allows lock and unlock admin op on MW NoRed SI accept the one assigned 
> on
> active SC.
>
> diff --git a/osaf/services/saf/amf/amfd/si.cc 
> b/osaf/services/saf/amf/amfd/si.cc
> --- a/osaf/services/saf/amf/amfd/si.cc
> +++ b/osaf/services/saf/amf/amfd/si.cc
> @@ -800,11 +800,29 @@ static void si_admin_op_cb(SaImmOiHandle
>
>   si = avd_si_get(objectName);
>   
> - if ((operationId != SA_AMF_ADMIN_SI_SWAP) && (si->sg_of_si->sg_ncs_spec 
> == true)) {
> + if ((operationId != SA_AMF_ADMIN_SI_SWAP) && (operationId != 
> SA_AMF_ADMIN_LOCK) &&
> + (operationId != SA_AMF_ADMIN_UNLOCK) && 
> (si->sg_of_si->sg_ncs_spec == true)) {
>   report_admin_op_error(immOiHandle, invocation, 
> SA_AIS_ERR_NOT_SUPPORTED, nullptr,
>   "Admin operation %llu on MW SI is not allowed", 
> operationId);
>   goto done;
>   }
> + if (((operationId == SA_AMF_ADMIN_LOCK) || (operationId == 
> SA_AMF_ADMIN_UNLOCK)) &&
> + (si->sg_of_si->sg_ncs_spec == true)) {
> + if (si->sg_of_si->sg_redundancy_model == 
> SA_AMF_2N_REDUNDANCY_MODEL) {
> + report_admin_op_error(immOiHandle, invocation,
> + SA_AIS_ERR_NOT_SUPPORTED, nullptr,
> + "Admin operation %llu on MW 2N SI is 
> not allowed", operationId);
> + goto done;
> + } else if ((si->sg_of_si->sg_redundancy_model == 
> SA_AMF_NO_REDUNDANCY_MODEL) &&
> + (si->list_of_sisu != nullptr) && (operationId 
> == SA_AMF_ADMIN_LOCK) &&
> + (avd_cb->node_id_avd == 
> si->list_of_sisu->su->su_on_node->node_info.nodeId)) {
> + //No specific reason, but conforming to existing 
> notions for active SC.
> + report_admin_op_error(immOiHandle, invocation,
> + SA_AIS_ERR_NOT_SUPPORTED, nullptr,
> + "Admin lock of MW SI assigned on Active SC is 
> not allowed");
> + goto done;
> + }
> + }
>   /* if Tolerance timer is running for any SI's withing this SG, then 
> return SA_AIS_ERR_TRY_AGAIN */
>  if (sg_is_tolerance_timer_running_for_any_si(si->sg_of_si)) {
>   report_admin_op_error(immOiHandle, invocation, 
> SA_AIS_ERR_TRY_AGAIN, nullptr,
>
> --
> Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
> Francisco, CA to explore cutting-edge tech and listen to tech luminaries
> present their vision of the future. This family event has something for
> everyone, including kids. Get more information and register today.
> http://sdm.link/attshape
> ___
> Opensaf-devel mailing list
> Opensaf-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/opensaf-devel
>

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 2 of 8] cpnd: Add support for extended SaNameT v1 [#1574]

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

On 6/23/2016 4:23 PM, Hoang Vo wrote:
> + buf = m_MMGR_ALLOC_CPND_DEFAULT(CPND_MAX_REPLICA_NAME_LENGTH);
> + memset(buf, '\0', CPND_MAX_REPLICA_NAME_LENGTH);
> + strncpy(buf, cp_node->ckpt_name, CPND_REP_NAME_MAX_CKPT_NAME_LENGTH);
> +
> + sprintf(buf + strlen(buf) - 1, "_%d_%llu", 
> (uint32_t)m_NCS_NODE_ID_FROM_MDS_DEST(cb->cpnd_mdest_id), cp_node->ckpt_id);

Dose REP_NAME Including node_id  will go  up to  Filename length limits 
on linux (255) ?

-AVM

On 6/23/2016 4:23 PM, Hoang Vo wrote:
>   osaf/libs/common/cpsv/include/cpnd.h  |   1 +
>   osaf/libs/common/cpsv/include/cpnd_cb.h   |   5 +-
>   osaf/libs/common/cpsv/include/cpnd_init.h |   3 +-
>   osaf/libs/common/cpsv/include/cpsv_shm.h  |   6 +-
>   osaf/services/saf/cpsv/cpnd/Makefile.am   |   1 +
>   osaf/services/saf/cpsv/cpnd/cpnd_db.c |   6 +-
>   osaf/services/saf/cpsv/cpnd/cpnd_evt.c|  71 ++
>   osaf/services/saf/cpsv/cpnd/cpnd_main.c   |   7 ++
>   osaf/services/saf/cpsv/cpnd/cpnd_proc.c   |  83 
> ++
>   osaf/services/saf/cpsv/cpnd/cpnd_res.c|  20 +++---
>   10 files changed, 143 insertions(+), 60 deletions(-)
>
>
> diff --git a/osaf/libs/common/cpsv/include/cpnd.h 
> b/osaf/libs/common/cpsv/include/cpnd.h
> --- a/osaf/libs/common/cpsv/include/cpnd.h
> +++ b/osaf/libs/common/cpsv/include/cpnd.h
> @@ -34,6 +34,7 @@
>   #define CPND_H
>   
>   #include 
> +#include "osaf_extended_name.h"
>   #include "ncssysf_def.h"
>   #include "ncs_main_papi.h"
>   #include "ncssysf_tsk.h"
> diff --git a/osaf/libs/common/cpsv/include/cpnd_cb.h 
> b/osaf/libs/common/cpsv/include/cpnd_cb.h
> --- a/osaf/libs/common/cpsv/include/cpnd_cb.h
> +++ b/osaf/libs/common/cpsv/include/cpnd_cb.h
> @@ -34,6 +34,9 @@ extern uint32_t gl_cpnd_cb_hdl;
>   #define m_CPND_GIVEUP_CPND_CBncshm_give_hdl(gl_cpnd_cb_hdl)
>   
>   #define CPND_MAX_REPLICAS 1000
> +#define CPND_REP_NAME_MAX_CKPT_NAME_LENGTH 150
> +#define CPND_MAX_REPLICA_NAME_LENGTH (CPND_REP_NAME_MAX_CKPT_NAME_LENGTH + 
> 50)
> +
>   #define CPSV_GEN_SECTION_ID_SIZE 4
>   #define CPSV_WAIT_TIME  1000
>   
> @@ -169,7 +172,7 @@ typedef struct cpnd_all_repl_write_evt_n
>   typedef struct cpnd_ckpt_node {
>   NCS_PATRICIA_NODE patnode;
>   SaCkptCheckpointHandleT ckpt_id;/* index for identifying the 
> checkpoint */
> - SaNameT ckpt_name;
> + SaConstStringT ckpt_name;
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> diff --git a/osaf/libs/common/cpsv/include/cpnd_init.h 
> b/osaf/libs/common/cpsv/include/cpnd_init.h
> --- a/osaf/libs/common/cpsv/include/cpnd_init.h
> +++ b/osaf/libs/common/cpsv/include/cpnd_init.h
> @@ -130,6 +130,7 @@ uint32_t cpnd_all_repl_rsp_expiry(CPND_C
>   uint32_t cpnd_open_active_sync_expiry(CPND_CB *cb, CPND_TMR_INFO *tmr_info);
>   void cpnd_proc_free_read_data(CPSV_EVT *evt);
>   SaUint32T cpnd_get_scAbsenceAllowed_attr();
> +SaUint32T cpnd_get_longDnsAllowed_attr();
>   /* End cpnd_proc.c */
>   
>   /* File : ---  cpnd_amf.c */
> @@ -163,7 +164,7 @@ void cpnd_evt_node_get(CPND_CB *cb, SaCk
>   void cpnd_evt_node_getnext(CPND_CB *cb, SaCkptCheckpointHandleT 
> lcl_ckpt_id, CPSV_CPND_ALL_REPL_EVT_NODE **evt_node);
>   uint32_t cpnd_evt_node_add(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
> *evt_node);
>   uint32_t cpnd_evt_node_del(CPND_CB *cb, CPSV_CPND_ALL_REPL_EVT_NODE 
> *evt_node);
> -CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaNameT 
> ckpt_name);
> +CPND_CKPT_NODE *cpnd_ckpt_node_find_by_name(CPND_CB *cpnd_cb, SaConstStringT 
> ckpt_name);
>   CPND_CKPT_SECTION_INFO *cpnd_ckpt_sec_add(CPND_CKPT_NODE *cp_node, 
> SaCkptSectionIdT *id, SaTimeT exp_time,
> uint32_t gen_flag);
>   void cpnd_evt_backup_queue_add(CPND_CKPT_NODE *cp_node, CPND_EVT *evt);
> diff --git a/osaf/libs/common/cpsv/include/cpsv_shm.h 
> b/osaf/libs/common/cpsv/include/cpsv_shm.h
> --- a/osaf/libs/common/cpsv/include/cpsv_shm.h
> +++ b/osaf/libs/common/cpsv/include/cpsv_shm.h
> @@ -18,6 +18,8 @@
>   #ifndef CPSV_SHM_H
>   #define CPSV_SHM_H
>   
> +#include "osaf_extended_name.h"
> +
>   #define MAX_CLIENTS 1000
>   #define MAX_CKPTS  2000
>   #define MAX_SIZE  30
> @@ -29,7 +31,7 @@
>   
>   typedef struct cpsv_ckpt_hdr {
>   SaCkptCheckpointHandleT ckpt_id;/* Index for identifying the 
> checkpoint */
> - SaNameT ckpt_name;
> + char ckpt_name[kOsafMaxDnLength];
>   SaCkptCheckpointCreationAttributesT create_attrib;
>   SaCkptCheckpointOpenFlagsT open_flags;
>   uint32_t ckpt_lcl_ref_cnt;
> @@ -55,7 +57,7 @@ typedef struct cpsv_sect_hdr {
>   } CPSV_SECT_HDR;
>   
>   typedef struct ckpt_info {
> - SaNameT ckpt_name;
> + char ckpt_name[kOsafMaxDnLength];
>   SaCkptCheckpointHandleT ckpt_id;
>   uint32_t maxSections;
>   SaSizeT maxSecSize;
> diff --git 

Re: [devel] [PATCH 0 of 1] Review Request for smfd:check smfNodeBundleActCmd at the time of modification [#1903]

2016-07-04 Thread Rafael Odzakow
ACK

On 06/30/2016 12:47 PM, reddy.neelaka...@oracle.com wrote:
> Summary:smfd:check smfNodeBundleActCmd at the time of modification [#1903]
> Review request for Trac Ticket(s): 1903
> Peer Reviewer(s): Lennart, Rafael
> Affected branch(es): 4.7.x, 5.0.x, default
> Development branch: default
>
> 
> Impacted area   Impact y/n
> 
>   Docsn
>   Build systemn
>   RPM/packaging   n
>   Configuration files n
>   Startup scripts n
>   SAF servicesy
>   OpenSAF servicesn
>   Core libraries  n
>   Samples n
>   Tests   n
>   Other   n
>
>
> Comments (indicate scope for each "y" above):
> -
>
> changeset 98c54fa4b5f4fe15362a4ef92f18ffe6bb25bb8e
> Author:   Neelakanta Reddy
> Date: Thu, 30 Jun 2016 16:13:10 +0530
>
>   smfd:check smfNodeBundleActCmd at the time of modification
>
>   smfd will crash when smfNodeBundleActCmd is set to NULL, because of 
> strdup.
>
>
> Complete diffstat:
> --
>   osaf/services/saf/smfsv/smfd/smfd_campaign_oi.cc |  3 +++
>   1 files changed, 3 insertions(+), 0 deletions(-)
>
>
> Testing Commands:
> -
> As explained in the description of the ticket
>
> Testing, Expected Results:
> --
> with this patch smfd should not crash
>
> Conditions of Submission:
> -
> Ack from Reviewers
>
> Arch  Built StartedLinux distro
> ---
> mipsn  n
> mips64  n  n
> x86 n  n
> x86_64  y  y
> powerpc n  n
> powerpc64   n  n
>
>
> Reviewer Checklist:
> ---
> [Submitters: make sure that your review doesn't trigger any checkmarks!]
>
>
> Your checkin has not passed review because (see checked entries):
>
> ___ Your RR template is generally incomplete; it has too many blank entries
>  that need proper data filled in.
>
> ___ You have failed to nominate the proper persons for review and push.
>
> ___ Your patches do not have proper short+long header
>
> ___ You have grammar/spelling in your header that is unacceptable.
>
> ___ You have exceeded a sensible line length in your headers/comments/text.
>
> ___ You have failed to put in a proper Trac Ticket # into your commits.
>
> ___ You have incorrectly put/left internal data in your comments/files
>  (i.e. internal bug tracking tool IDs, product names etc)
>
> ___ You have not given any evidence of testing beyond basic build tests.
>  Demonstrate some level of runtime or other sanity testing.
>
> ___ You have ^M present in some of your files. These have to be removed.
>
> ___ You have needlessly changed whitespace or added whitespace crimes
>  like trailing spaces, or spaces before tabs.
>
> ___ You have mixed real technical changes with whitespace and other
>  cosmetic code cleanup changes. These have to be separate commits.
>
> ___ You need to refactor your submission into logical chunks; there is
>  too much content into a single commit.
>
> ___ You have extraneous garbage in your review (merge commits etc)
>
> ___ You have giant attachments which should never have been sent;
>  Instead you should place your content in a public tree to be pulled.
>
> ___ You have too many commits attached to an e-mail; resend as threaded
>  commits, or place in a public tree for a pull.
>
> ___ You have resent this content multiple times without a clear indication
>  of what has changed between each re-send.
>
> ___ You have failed to adequately and individually address all of the
>  comments and change requests that were proposed in the initial review.
>
> ___ You have a misconfigured ~/.hgrc file (i.e. username, email etc)
>
> ___ Your computer have a badly configured date and time; confusing the
>  the threaded patch review.
>
> ___ Your changes affect IPC mechanism, and you don't present any results
>  for in-service upgradability test.
>
> ___ Your changes affect user manual and documentation, your patch series
>  do not contain the patch that updates the Doxygen manual.
>


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] libs/core: add support for long DN in sanamet encode & decode functions [#1674]

2016-07-04 Thread ramesh betham
Ack. Code review only.
Hope testing covers backward compatibility validations.

Regards,
Ramesh.

On 7/4/2016 1:56 PM, Gary Lee wrote:
> Just a friendly reminder to review this patch.
>
> I would like to push the patch, as we’re planning to send out the long DN 
> patches for AMF this week, which is based on this proposal.
>
> Thanks
> Gary
>
>> On 23 Jun 2016, at 4:17 PM, Gary Lee  wrote:
>>
>> osaf/libs/core/common/saf_edu.c|   34 ++
>> osaf/libs/core/include/ncsencdec_pub.h |3 +
>> osaf/libs/core/leap/hj_enc.c   |  100 
>> ++--
>> 3 files changed, 102 insertions(+), 35 deletions(-)
>>
>>
>> Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2 
>> bytes,
>> followed by a fixed char array of length SA_MAX_NAME_LENGTH.
>>
>> This patch adds long DN supoprt by:
>>
>> if length < SA_MAX_NAME_LENGTH, encode as present
>> if length >= SA_MAX_NAME_LENGTH, encode as a variable string like 
>> ncs_edp_string
>>
>> diff --git a/osaf/libs/core/common/saf_edu.c 
>> b/osaf/libs/core/common/saf_edu.c
>> --- a/osaf/libs/core/common/saf_edu.c
>> +++ b/osaf/libs/core/common/saf_edu.c
>> @@ -42,6 +42,7 @@
>> #include "saf_mem.h"
>> #include "ncs_edu_pub.h"
>> #include "ncs_saf_edu.h"
>> +#include "osaf_extended_name.h"
>>
>> /*
>>
>> @@ -57,36 +58,15 @@
>> uint32_t ncs_edp_sanamet(EDU_HDL *hdl, EDU_TKN *edu_tkn,
>>NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
>> *buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
>> {
>> -uint32_t rc = NCSCC_RC_SUCCESS;
>> -SaNameT *struct_ptr = NULL, **d_ptr = NULL;
>> -
>> -EDU_INST_SET saname_rules[] = {
>> -{EDU_START, ncs_edp_sanamet, 0, 0, 0, sizeof(SaNameT), 0, NULL},
>> -{EDU_EXEC, m_NCS_EDP_SAUINT16T, 0, 0, 0,
>> - (long)&((SaNameT *)0)->length, 0, NULL},
>> -{EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
>> - (long)&((SaNameT *)0)->value, SA_MAX_NAME_LENGTH, NULL},
>> -{EDU_END, 0, 0, 0, 0, 0, 0, NULL},
>> -};
>> -
>>  if (op == EDP_OP_TYPE_ENC) {
>> -struct_ptr = (SaNameT *)ptr;
>> +const SaNameT *name = ptr;
>> +osaf_encode_sanamet(buf_env->info.uba, name);
>>  } else if (op == EDP_OP_TYPE_DEC) {
>> -d_ptr = (SaNameT **)ptr;
>> -if (*d_ptr == NULL) {
>> -*d_ptr = m_MMGR_ALLOC_EDP_SANAMET;
>> -if (*d_ptr == NULL) {
>> -*o_err = EDU_ERR_MEM_FAIL;
>> -return NCSCC_RC_FAILURE;
>> -}
>> -}
>> -memset(*d_ptr, '\0', sizeof(SaNameT));
>> -struct_ptr = *d_ptr;
>> -} else {
>> -struct_ptr = ptr;
>> +SaNameT *name = *(SaNameT**)ptr;
>> +osaf_decode_sanamet(buf_env->info.uba, name);
>>  }
>> -rc = m_NCS_EDU_RUN_RULES(hdl, edu_tkn, saname_rules, struct_ptr, 
>> ptr_data_len, buf_env, op, o_err);
>> -return rc;
>> +
>> +return NCSCC_RC_SUCCESS;
>> }
>>
>> /*
>> diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
>> b/osaf/libs/core/include/ncsencdec_pub.h
>> --- a/osaf/libs/core/include/ncsencdec_pub.h
>> +++ b/osaf/libs/core/include/ncsencdec_pub.h
>> @@ -153,6 +153,9 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
>> void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
>> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
>> void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
>> +void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
>> +void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
>> +void osaf_decode_sastring(NCS_UBAID *ub, SaStringT* str);
>> void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
>> void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
>> void osaf_encode_bool(NCS_UBAID *ub, bool value);
>> diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
>> --- a/osaf/libs/core/leap/hj_enc.c
>> +++ b/osaf/libs/core/leap/hj_enc.c
>> @@ -42,6 +42,9 @@
>>
>> ***
>> */
>> +#ifndef SA_EXTENDED_NAME_SOURCE
>> +#define SA_EXTENDED_NAME_SOURCE
>> +#endif
>>
>> #include 
>> #include "ncs_osprm.h"
>> @@ -49,6 +52,7 @@
>> #include "ncssysf_def.h"
>> #include "ncssysf_mem.h"
>> #include "ncs_svd.h"
>> +#include "osaf_extended_name.h"
>>
>> /** A NULL os implies "count" number of zeros...
>>   **/
>> @@ -374,18 +378,49 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
>>
>> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
>> {
>> -int i;
>> -osaf_encode_uint16(ub, name->length);
>> -for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
>> -osaf_encode_uint8(ub, name->value[i]);
>> +TRACE_ENTER();
>> +
>> +

[devel] [PATCH 1 of 1] imm: Return ERR_NO_RESOURCES to IMM when PBE fails to get ccb outcome [#1904]

2016-07-04 Thread Hung Nguyen
 osaf/libs/common/immsv/immpbe_dump.cc|  4 ++--
 osaf/services/saf/immsv/immpbed/immpbe_daemon.cc |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


When getting ccb outcome after a restart, if PBE fails to find the CCB, 
ERR_NO_RESOURCES will be returned to IMM server.
That way the ccb will be marked as resource aborted, and user will be able to 
retry the ccb.

diff --git a/osaf/libs/common/immsv/immpbe_dump.cc 
b/osaf/libs/common/immsv/immpbe_dump.cc
--- a/osaf/libs/common/immsv/immpbe_dump.cc
+++ b/osaf/libs/common/immsv/immpbe_dump.cc
@@ -3054,7 +3054,7 @@ SaAisErrorT getCcbOutcomeFromPbe(void* d
sqlite3* dbHandle = (sqlite3 *) db_handle;
sqlite3_stmt *stmt;
int rc=0;
-   SaAisErrorT err = SA_AIS_ERR_BAD_OPERATION;
+   SaAisErrorT err = SA_AIS_ERR_NO_RESOURCES;
bool badfile=false;
 
TRACE_ENTER2("get Outcome for ccb:%llu", ccbId);
@@ -3068,7 +3068,7 @@ SaAisErrorT getCcbOutcomeFromPbe(void* d
if(rc == SQLITE_DONE) {
sqlite3_reset(stmt);
LOG_NO("getCcbOutcomeFromPbe: Could not find ccb %llu presume 
ABORT", ccbId);
-   err = SA_AIS_ERR_BAD_OPERATION;
+   err = SA_AIS_ERR_NO_RESOURCES;
} else if(rc != SQLITE_ROW) {
LOG_ER("SQL statement ('%s') failed because:\n %s",
preparedSql[SQL_SEL_CCB_COMMITS], 
sqlite3_errmsg(dbHandle));
diff --git a/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc 
b/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
--- a/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
+++ b/osaf/services/saf/immsv/immpbed/immpbe_daemon.cc
@@ -1377,7 +1377,7 @@ static SaAisErrorT saImmOiCcbCompletedCa
 
if ((ccbUtilCcbData = ccbutil_findCcbData(ccbId)) == NULL) {
LOG_WA("Failed to find CCB object for %llx/%llu - checking DB 
file for outcome", ccbId, ccbId);
-   rc = getCcbOutcomeFromPbe(sDbHandle, ccbId, sEpoch);/* 
rc=BAD_OPERATION or OK */
+   rc = getCcbOutcomeFromPbe(sDbHandle, ccbId, sEpoch);/* 
rc=NO_RESOURCES or OK */
(void) ccbutil_getCcbData(ccbId); /*generate an empty record*/
goto done;
}

--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
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: Return ERR_NO_RESOURCES to IMM when PBE fails to get ccb outcome [#1904]

2016-07-04 Thread Hung Nguyen
Summary: imm: Return ERR_NO_RESOURCES to IMM when PBE fails to get ccb outcome 
[#1904]
Review request for Trac Ticket(s): 1904
Peer Reviewer(s): Zoran, Neel
Pull request to:
Affected branch(es): 4.7, 5.0, 5.1
Development branch: 5.1


Impacted area   Impact y/n

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


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


changeset a0d2a73460e2047e6bf8f487c753a239cf0836ae
Author: Hung Nguyen 
Date:   Mon, 04 Jul 2016 17:33:44 +0700

imm: Return ERR_NO_RESOURCES to IMM when PBE fails to get ccb outcome
[#1904]

When getting ccb outcome after a restart, if PBE fails to find the CCB,
ERR_NO_RESOURCES will be returned to IMM server. That way the ccb will 
be
marked as resource aborted, and user will be able to retry the ccb.


Complete diffstat:
--
 osaf/libs/common/immsv/immpbe_dump.cc|  4 ++--
 osaf/services/saf/immsv/immpbed/immpbe_daemon.cc |  2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)


Testing Commands:
-
Make pbe restart when ccb in critical state.


Testing, Expected Results:
--
After pbe starts again, resource abort is returned to om client.


Conditions of Submission:
-
Ack from reviewers.


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


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


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

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

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

___ Your patches do not have proper short+long header

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


--
Attend Shape: An AT Tech Expo July 15-16. Meet us at AT Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] libs/core: add support for long DN in sanamet encode & decode functions [#1674]

2016-07-04 Thread ramesh betham
Hi Gary, will try to post my comments by tomorrow at max.

Thanks,
Ramesh.

On 7/4/2016 1:56 PM, Gary Lee wrote:
> Just a friendly reminder to review this patch.
>
> I would like to push the patch, as we’re planning to send out the long DN 
> patches for AMF this week, which is based on this proposal.
>
> Thanks
> Gary
>
>> On 23 Jun 2016, at 4:17 PM, Gary Lee  wrote:
>>
>> osaf/libs/core/common/saf_edu.c|   34 ++
>> osaf/libs/core/include/ncsencdec_pub.h |3 +
>> osaf/libs/core/leap/hj_enc.c   |  100 
>> ++--
>> 3 files changed, 102 insertions(+), 35 deletions(-)
>>
>>
>> Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2 
>> bytes,
>> followed by a fixed char array of length SA_MAX_NAME_LENGTH.
>>
>> This patch adds long DN supoprt by:
>>
>> if length < SA_MAX_NAME_LENGTH, encode as present
>> if length >= SA_MAX_NAME_LENGTH, encode as a variable string like 
>> ncs_edp_string
>>
>> diff --git a/osaf/libs/core/common/saf_edu.c 
>> b/osaf/libs/core/common/saf_edu.c
>> --- a/osaf/libs/core/common/saf_edu.c
>> +++ b/osaf/libs/core/common/saf_edu.c
>> @@ -42,6 +42,7 @@
>> #include "saf_mem.h"
>> #include "ncs_edu_pub.h"
>> #include "ncs_saf_edu.h"
>> +#include "osaf_extended_name.h"
>>
>> /*
>>
>> @@ -57,36 +58,15 @@
>> uint32_t ncs_edp_sanamet(EDU_HDL *hdl, EDU_TKN *edu_tkn,
>>NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
>> *buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
>> {
>> -uint32_t rc = NCSCC_RC_SUCCESS;
>> -SaNameT *struct_ptr = NULL, **d_ptr = NULL;
>> -
>> -EDU_INST_SET saname_rules[] = {
>> -{EDU_START, ncs_edp_sanamet, 0, 0, 0, sizeof(SaNameT), 0, NULL},
>> -{EDU_EXEC, m_NCS_EDP_SAUINT16T, 0, 0, 0,
>> - (long)&((SaNameT *)0)->length, 0, NULL},
>> -{EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
>> - (long)&((SaNameT *)0)->value, SA_MAX_NAME_LENGTH, NULL},
>> -{EDU_END, 0, 0, 0, 0, 0, 0, NULL},
>> -};
>> -
>>  if (op == EDP_OP_TYPE_ENC) {
>> -struct_ptr = (SaNameT *)ptr;
>> +const SaNameT *name = ptr;
>> +osaf_encode_sanamet(buf_env->info.uba, name);
>>  } else if (op == EDP_OP_TYPE_DEC) {
>> -d_ptr = (SaNameT **)ptr;
>> -if (*d_ptr == NULL) {
>> -*d_ptr = m_MMGR_ALLOC_EDP_SANAMET;
>> -if (*d_ptr == NULL) {
>> -*o_err = EDU_ERR_MEM_FAIL;
>> -return NCSCC_RC_FAILURE;
>> -}
>> -}
>> -memset(*d_ptr, '\0', sizeof(SaNameT));
>> -struct_ptr = *d_ptr;
>> -} else {
>> -struct_ptr = ptr;
>> +SaNameT *name = *(SaNameT**)ptr;
>> +osaf_decode_sanamet(buf_env->info.uba, name);
>>  }
>> -rc = m_NCS_EDU_RUN_RULES(hdl, edu_tkn, saname_rules, struct_ptr, 
>> ptr_data_len, buf_env, op, o_err);
>> -return rc;
>> +
>> +return NCSCC_RC_SUCCESS;
>> }
>>
>> /*
>> diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
>> b/osaf/libs/core/include/ncsencdec_pub.h
>> --- a/osaf/libs/core/include/ncsencdec_pub.h
>> +++ b/osaf/libs/core/include/ncsencdec_pub.h
>> @@ -153,6 +153,9 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
>> void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
>> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
>> void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
>> +void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
>> +void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
>> +void osaf_decode_sastring(NCS_UBAID *ub, SaStringT* str);
>> void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
>> void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
>> void osaf_encode_bool(NCS_UBAID *ub, bool value);
>> diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
>> --- a/osaf/libs/core/leap/hj_enc.c
>> +++ b/osaf/libs/core/leap/hj_enc.c
>> @@ -42,6 +42,9 @@
>>
>> ***
>> */
>> +#ifndef SA_EXTENDED_NAME_SOURCE
>> +#define SA_EXTENDED_NAME_SOURCE
>> +#endif
>>
>> #include 
>> #include "ncs_osprm.h"
>> @@ -49,6 +52,7 @@
>> #include "ncssysf_def.h"
>> #include "ncssysf_mem.h"
>> #include "ncs_svd.h"
>> +#include "osaf_extended_name.h"
>>
>> /** A NULL os implies "count" number of zeros...
>>   **/
>> @@ -374,18 +378,49 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
>>
>> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
>> {
>> -int i;
>> -osaf_encode_uint16(ub, name->length);
>> -for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
>> -osaf_encode_uint8(ub, name->value[i]);
>> +TRACE_ENTER();
>> +
>> +SaConstStringT str = 

Re: [devel] [PATCH 1 of 1] libs/core: add support for long DN in sanamet encode & decode functions [#1674]

2016-07-04 Thread Gary Lee
Just a friendly reminder to review this patch.

I would like to push the patch, as we’re planning to send out the long DN 
patches for AMF this week, which is based on this proposal.

Thanks
Gary

> On 23 Jun 2016, at 4:17 PM, Gary Lee  wrote:
> 
> osaf/libs/core/common/saf_edu.c|   34 ++
> osaf/libs/core/include/ncsencdec_pub.h |3 +
> osaf/libs/core/leap/hj_enc.c   |  100 ++--
> 3 files changed, 102 insertions(+), 35 deletions(-)
> 
> 
> Currently, ncs_edp_sanamet encodes a SaNameT by storing the length in 2 bytes,
> followed by a fixed char array of length SA_MAX_NAME_LENGTH.
> 
> This patch adds long DN supoprt by:
> 
> if length < SA_MAX_NAME_LENGTH, encode as present
> if length >= SA_MAX_NAME_LENGTH, encode as a variable string like 
> ncs_edp_string
> 
> diff --git a/osaf/libs/core/common/saf_edu.c b/osaf/libs/core/common/saf_edu.c
> --- a/osaf/libs/core/common/saf_edu.c
> +++ b/osaf/libs/core/common/saf_edu.c
> @@ -42,6 +42,7 @@
> #include "saf_mem.h"
> #include "ncs_edu_pub.h"
> #include "ncs_saf_edu.h"
> +#include "osaf_extended_name.h"
> 
> /*
> 
> @@ -57,36 +58,15 @@
> uint32_t ncs_edp_sanamet(EDU_HDL *hdl, EDU_TKN *edu_tkn,
> NCSCONTEXT ptr, uint32_t *ptr_data_len, EDU_BUF_ENV 
> *buf_env, EDP_OP_TYPE op, EDU_ERR *o_err)
> {
> - uint32_t rc = NCSCC_RC_SUCCESS;
> - SaNameT *struct_ptr = NULL, **d_ptr = NULL;
> -
> - EDU_INST_SET saname_rules[] = {
> - {EDU_START, ncs_edp_sanamet, 0, 0, 0, sizeof(SaNameT), 0, NULL},
> - {EDU_EXEC, m_NCS_EDP_SAUINT16T, 0, 0, 0,
> -  (long)&((SaNameT *)0)->length, 0, NULL},
> - {EDU_EXEC, ncs_edp_uns8, EDQ_ARRAY, 0, 0,
> -  (long)&((SaNameT *)0)->value, SA_MAX_NAME_LENGTH, NULL},
> - {EDU_END, 0, 0, 0, 0, 0, 0, NULL},
> - };
> -
>   if (op == EDP_OP_TYPE_ENC) {
> - struct_ptr = (SaNameT *)ptr;
> + const SaNameT *name = ptr;
> + osaf_encode_sanamet(buf_env->info.uba, name);
>   } else if (op == EDP_OP_TYPE_DEC) {
> - d_ptr = (SaNameT **)ptr;
> - if (*d_ptr == NULL) {
> - *d_ptr = m_MMGR_ALLOC_EDP_SANAMET;
> - if (*d_ptr == NULL) {
> - *o_err = EDU_ERR_MEM_FAIL;
> - return NCSCC_RC_FAILURE;
> - }
> - }
> - memset(*d_ptr, '\0', sizeof(SaNameT));
> - struct_ptr = *d_ptr;
> - } else {
> - struct_ptr = ptr;
> + SaNameT *name = *(SaNameT**)ptr;
> + osaf_decode_sanamet(buf_env->info.uba, name);
>   }
> - rc = m_NCS_EDU_RUN_RULES(hdl, edu_tkn, saname_rules, struct_ptr, 
> ptr_data_len, buf_env, op, o_err);
> - return rc;
> + 
> + return NCSCC_RC_SUCCESS;
> }
> 
> /*
> diff --git a/osaf/libs/core/include/ncsencdec_pub.h 
> b/osaf/libs/core/include/ncsencdec_pub.h
> --- a/osaf/libs/core/include/ncsencdec_pub.h
> +++ b/osaf/libs/core/include/ncsencdec_pub.h
> @@ -153,6 +153,9 @@ void osaf_encode_uint64(NCS_UBAID *ub, u
> void osaf_decode_uint64(NCS_UBAID *ub, uint64_t *to);
> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name);
> void osaf_decode_sanamet(NCS_UBAID *ub, SaNameT *name);
> +void osaf_encode_sanamet_o2(NCS_UBAID *ub, SaConstStringT name);
> +void osaf_encode_saconststring(NCS_UBAID *ub, SaConstStringT str);
> +void osaf_decode_sastring(NCS_UBAID *ub, SaStringT* str);
> void osaf_encode_satimet(NCS_UBAID *ub, SaTimeT time);
> void osaf_decode_satimet(NCS_UBAID *ub, SaTimeT *time);
> void osaf_encode_bool(NCS_UBAID *ub, bool value);
> diff --git a/osaf/libs/core/leap/hj_enc.c b/osaf/libs/core/leap/hj_enc.c
> --- a/osaf/libs/core/leap/hj_enc.c
> +++ b/osaf/libs/core/leap/hj_enc.c
> @@ -42,6 +42,9 @@
> 
> ***
> */
> +#ifndef SA_EXTENDED_NAME_SOURCE
> +#define SA_EXTENDED_NAME_SOURCE
> +#endif
> 
> #include 
> #include "ncs_osprm.h"
> @@ -49,6 +52,7 @@
> #include "ncssysf_def.h"
> #include "ncssysf_mem.h"
> #include "ncs_svd.h"
> +#include "osaf_extended_name.h"
> 
> /** A NULL os implies "count" number of zeros...
>  **/
> @@ -374,18 +378,49 @@ void osaf_decode_uint64(NCS_UBAID *ub, u
> 
> void osaf_encode_sanamet(NCS_UBAID *ub, const SaNameT *name)
> {
> - int i;
> - osaf_encode_uint16(ub, name->length);
> - for (i = 0; i < SA_MAX_NAME_LENGTH; i++)
> - osaf_encode_uint8(ub, name->value[i]);
> + TRACE_ENTER();
> +
> + SaConstStringT str = osaf_extended_name_borrow(name);
> + TRACE("str %s (%zu)", str, osaf_extended_name_length(name));
> + osaf_encode_sanamet_o2(ub, str);
> +
> + TRACE_LEAVE();
> }
> 
> void