osaf/services/saf/amf/amfd/sg_nway_fsm.cc |  2 ++
 osaf/services/saf/amf/amfd/su.cc          |  2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)


More SIs then configured with saAmfSGMaxActiveSIsperSU can be assigned to an SU.

The algorithm in avd_sg_nway_si_assign() does not continue with the next SU
after it has assigned the first SI. It keeps assigning the first SU with more
SIs.

The patch resets the curr_su pointer to start over again for each SI.

diff --git a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc 
b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
--- a/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
+++ b/osaf/services/saf/amf/amfd/sg_nway_fsm.cc
@@ -1394,6 +1394,8 @@ uint32_t avd_sg_nway_si_assign(AVD_CL_CB
                        } else {
                                LOG_ER("%s:%u: %s (%u)", __FILE__, __LINE__, 
curr_si->name.value, curr_si->name.length);
                        }
+
+                       curr_su = NULL; // start over
                } else
                        break;
        }                       /* for */
diff --git a/osaf/services/saf/amf/amfd/su.cc b/osaf/services/saf/amf/amfd/su.cc
--- a/osaf/services/saf/amf/amfd/su.cc
+++ b/osaf/services/saf/amf/amfd/su.cc
@@ -1610,6 +1610,7 @@ static void su_ccb_apply_cb(CcbUtilOpera
 
 void AVD_SU::inc_curr_act_si() {
        saAmfSUNumCurrActiveSIs++;
+       osafassert(saAmfSUNumCurrActiveSIs <= 
sg_of_su->saAmfSGMaxActiveSIsperSU);
        TRACE("%s saAmfSUNumCurrActiveSIs=%u", name.value,
                saAmfSUNumCurrActiveSIs);
        m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, 
AVSV_CKPT_SU_SI_CURR_ACTIVE);
@@ -1625,6 +1626,7 @@ void AVD_SU::dec_curr_act_si() {
 
 void AVD_SU::inc_curr_stdby_si() {
        saAmfSUNumCurrStandbySIs++;
+       osafassert(saAmfSUNumCurrStandbySIs <= 
sg_of_su->saAmfSGMaxStandbySIsperSU);
        TRACE("%s saAmfSUNumCurrStandbySIs=%u", name.value,
                saAmfSUNumCurrStandbySIs);
        m_AVSV_SEND_CKPT_UPDT_ASYNC_UPDT(avd_cb, this, 
AVSV_CKPT_SU_SI_CURR_STBY);

------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Opensaf-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensaf-devel

Reply via email to