osaf/services/saf/amf/amfd/role.cc | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
After headless, for some reasons the SU read from IMM does not gaurantee
to be the same order as they were added via ccb. That will not maintain
the mapping between node and su, which later would cause a crash of amfnd
After headless, saAmfSUHostedByNode is read empty so map_su_to_node()
does re-mapping which is a wrong one, and su_add_to_model() also updated
this wrong mapping to IMM. The only right mapping exists in the sync
information where amfd retrieves from avd_susi_recreate(). But this is
also where the problem comes, because payload will reuse the order before
headless and that possibly cause a node mapped to two different SU(s).
Patch makes active/standby amfd becoming early implementer/applier so
that saAmfSUHostedByNode is read non-empty, and there will not be a re-map
due to blank saAmfSUHostedByNode inside function map_su_to_node().
diff --git a/osaf/services/saf/amf/amfd/role.cc
b/osaf/services/saf/amf/amfd/role.cc
--- a/osaf/services/saf/amf/amfd/role.cc
+++ b/osaf/services/saf/amf/amfd/role.cc
@@ -260,6 +260,11 @@ uint32_t avd_active_role_initialization(
TRACE_ENTER();
+ if (avd_imm_impl_set() != SA_AIS_OK) {
+ LOG_ER("avd_imm_impl_set FAILED");
+ goto done;
+ }
+
if (avd_imm_config_get() != NCSCC_RC_SUCCESS) {
LOG_ER("avd_imm_config_get FAILED");
goto done;
@@ -267,11 +272,6 @@ uint32_t avd_active_role_initialization(
cb->init_state = AVD_CFG_DONE;
- if (avd_imm_impl_set() != SA_AIS_OK) {
- LOG_ER("avd_imm_impl_set FAILED");
- goto done;
- }
-
avd_imm_update_runtime_attrs();
status = NCSCC_RC_SUCCESS;
@@ -294,6 +294,11 @@ uint32_t avd_standby_role_initialization
TRACE_ENTER();
+ if (avd_imm_applier_set() != SA_AIS_OK) {
+ LOG_ER("avd_imm_applier_set FAILED");
+ goto done;
+ }
+
if (avd_imm_config_get() != NCSCC_RC_SUCCESS) {
LOG_ER("avd_imm_config_get FAILED");
goto done;
@@ -301,11 +306,6 @@ uint32_t avd_standby_role_initialization
cb->init_state = AVD_CFG_DONE;
- if (avd_imm_applier_set() != SA_AIS_OK) {
- LOG_ER("avd_imm_applier_set FAILED");
- goto done;
- }
-
status = NCSCC_RC_SUCCESS;
done:
TRACE_LEAVE();
------------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel