---
** [tickets:#2576] imm: Admin owner name is overwritten when committing
modification**
**Status:** accepted
**Milestone:** 5.17.10
**Created:** Fri Sep 08, 2017 07:12 AM UTC by Hung Nguyen
**Last Updated:** Fri Sep 08, 2017 07:12 AM UTC
**Owner:** Hung Nguyen
**Attachments:**
-
[reproduce_n_logs.tgz](https://sourceforge.net/p/opensaf/tickets/2576/attachment/reproduce_n_logs.tgz)
(14.7 kB; application/x-compressed)
Steps to reproduce:
* Create an object to test. The xml file can be found attached in this ticket.
~~~
# immcfg -f /hostfs/TestClass_simple.xml
# immcfg -c Test test=1
~~~
* Delay the CcbCompleted callback of pbe to simulate IO/disk latency.
The gdb file can be found in attachments of this ticket.
~~~
# gdb --command=pbe_delay_committing.gdb /usr/local/lib/opensaf/osafimmpbed
$(pidof osafimmpbed)
~~~
* Run the test. The source code of the test can be found attached to this
ticket.
~~~
# ccb_modify_test
~~~
* Now check the admo name of the object, it will show **"admo1"** (it should be
**"admo2"**).
~~~
# immlist -a SaImmAttrAdminOwnerName test=1
SaImmAttrAdminOwnerName=admo1
~~~
-----
Here's what the test does:
* Create a CCB and modify **"test=1"**. The admo name is **"admo1"**.
~~~cpp
saImmOmInitialize(&handle, NULL, &version);
saImmOmAdminOwnerInitialize(handle, "admo1", SA_TRUE, &owner_handle);
saImmOmAdminOwnerSet(owner_handle, {"test=1"}, SA_IMM_ONE);
saImmOmCcbInitialize(owner_handle, 0, &ccb_handle);
saImmOmCcbObjectModify_2(ccb_handle, "test=1", attr_mods);
~~~
* saImmOmCcbApply returns ERR_TIMEOUT as we delay PBE.
~~~cpp
saImmOmCcbApply(ccb_handle);
~~~
* Finalize the handle
~~~cpp
saImmOmFinalize(handle);
~~~
* Initialize new admo and set to the same object **"test=1"**. **ROF** is
**FALSE**.
~~~cpp
saImmOmInitialize(&handle, NULL, &version);
saImmOmAdminOwnerInitialize(handle, "admo2", SA_FALSE, &owner_handle);
saImmOmAdminOwnerSet(owner_handle, object_names, SA_IMM_ONE);
saImmOmFinalize(handle);
~~~
* At this time the admo that is set to the object is **"admo2"**.
* But when the ccb is committed, the admo name (**"admo2"**) is overwritten by
the admo name in the after image (**"admo1"**).
~~~
11:39:49 SC-1 osafimmnd[214]: NO Ccb 3 COMMITTED (<released>)
~~~
~~~cpp
11:39:49.132941 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6096] >> ccbCommit
11:39:49.132946 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6103] T5 Commit
CCB 3
11:39:49.132950 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6109] T5 Ccb 3
comitted by PBE now in state:9
11:39:49.132954 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6111] T5 Comitting
Ccb 3 in IMMND
11:39:49.132959 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:5934] >>
commitModify
11:39:49.132964 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:5935] T5 COMMITING
MODIFY of test=1
11:39:49.132989 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6027] <<
commitModify
11:39:49.133893 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:6194] NO Ccb 3
COMMITTED (<released>)
11:39:49.133929 osafimmnd [214:214:src/imm/immnd/ImmModel.cc:0000] << ccbCommit
for (oavi = afterImage->mAttrValueMap.begin();
oavi != afterImage->mAttrValueMap.end(); ++oavi) {
AttrMap::iterator i4 = classInfo->mAttrMap.find(oavi->first);
osafassert(i4 != classInfo->mAttrMap.end());
osafassert(i4->second->mFlags & SA_IMM_ATTR_CONFIG);
beforeImage->mAttrValueMap[oavi->first] = oavi->second;
if (oavi->first == std::string(SA_IMM_ATTR_ADMIN_OWNER_NAME)) {
beforeImage->mAdminOwnerAttrVal = oavi->second;
}
}
~~~
---
Sent from sourceforge.net because opensaf-tickets@lists.sourceforge.net is
subscribed to https://sourceforge.net/p/opensaf/tickets/
To unsubscribe from further messages, a project admin can change settings at
https://sourceforge.net/p/opensaf/admin/tickets/options. Or, if this is a
mailing list, you can unsubscribe from the mailing list.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Opensaf-tickets mailing list
Opensaf-tickets@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-tickets