Ack. -----Original Message----- From: Thien Minh Huynh <thien.m.hu...@dektech.com.au> Sent: Tuesday, September 20, 2022 5:48 PM To: Thang Duc Nguyen <thang.d.ngu...@dektech.com.au>; Minh Hon Chau <minh.c...@dektech.com.au>; Hieu Hong Hoang <hieu.h.ho...@dektech.com.au> Cc: opensaf-devel@lists.sourceforge.net; Thien Minh Huynh <thien.m.hu...@dektech.com.au> Subject: [PATCH 1/1] imm: fix multiple value attribute out of order [#3321]
Create an object that has multiple value attributes. After that, IMMND send the create callback to IMMPBED. But the value is sent in the same order as when it was created. IMMND will load data from immpbed after the cluster reboots. That leads to multiple values being out of order after the reboot. This is to correct the order of multiple values in the OI/OM callback. when loaded from sqlite, change push_front to push_back. --- src/imm/agent/imma_proc.cc | 2 +- src/imm/immloadd/imm_pbe_load.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/imm/agent/imma_proc.cc b/src/imm/agent/imma_proc.cc index c048654f9..38a377a24 100644 --- a/src/imm/agent/imma_proc.cc +++ b/src/imm/agent/imma_proc.cc @@ -2108,7 +2108,7 @@ static void imma_proc_ccbaug_setup(IMMA_CLIENT_NODE *cl_node, if (q->attrValuesNumber > 1) { int ix; IMMSV_EDU_ATTR_VAL_LIST *r = q->attrMoreValues; - for (ix = 1; ix < q->attrValuesNumber; ++ix) { + for (ix = q->attrValuesNumber - 1; ix > 0; --ix) { osafassert(r); attr[i]->attrValues[ix] = /*alloc-5 */ imma_copyAttrValue3((SaImmValueTypeT)q->attrValueType, &(r->n)); diff --git a/src/imm/immloadd/imm_pbe_load.cc b/src/imm/immloadd/imm_pbe_load.cc index 5f5aefcec..945aff718 100644 --- a/src/imm/immloadd/imm_pbe_load.cc +++ b/src/imm/immloadd/imm_pbe_load.cc @@ -652,13 +652,13 @@ bool loadObjectFromPbe(void *pbeHandle, SaImmHandleT immHandle, val = (char *)realloc(val, size); snprintf(val, size, "%.17g", d); } - attrValueBuffers.push_front(val); + attrValueBuffers.push_back(val); } else { val = (char *)sqlite3_column_text(stmt, 0); if (val) { /* Guard for NULL values. */ char *str = strdup(val); - attrValueBuffers.push_front(str); + attrValueBuffers.push_back(str); TRACE("ABT pushed value:%s", str); } } -- 2.25.1 _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel