[Openais] More ACTIVE units than the number defined in group.conf exist

SAKAI MIYOTAKA sakai.miyotaka at nttcom.co.jp
Sat Sep 4 10:42:00 PDT 2004


Steve ,

I made the patch attached to this message .

I did  another  changes to  this patch.

1.  eliminate compile warning of lib/evs.c
2.   addtion  "evsbench"  to  make  clean  target

Regards
- Miyotaka sakai

SAKAI MIYOTAKA wrote:

>Steve,
>
>  =

>
>>Could you use the diff -uNr command to make a patch with your change,
>>and I'll merge the patch?
>>
>>    =

>>
>It is OK with me .
>Please gime me a time , because amf.c in may laptop has some printfs for
>log .
>
>  =

>
>>The current distributed state machine (this is
>>why the code begins with dsm*)
>>
>>    =

>>
>I would have liked to know what dsm stands for . It's a good name .
>
>Thanks .
>Miyotaka sakai .
>
>Steven Dake wrote:
>
>  =

>
>>Sakai-san,
>>
>>Great catch your right.  The current distributed state machine (this is
>>why the code begins with dsm*) expects out of service to be entered from
>>in_service/active, but this isn't a correct assumption.  The out of
>>service state can also be entered in in_service/standby.
>>
>>Over the long term we need a reanalysis of the state machine with a
>>clear documentation and testing approach.. Its a 3rd generation state
>>machine, but I am not totally comfortable with it yet.
>>
>>Could you use the diff -uNr command to make a patch with your change,
>>and I'll merge the patch?
>>
>>Regards
>>-steve
>>
>>On Fri, 2004-09-03 at 17:59, SAKAI MIYOTAKA wrote:
>>    =

>>
>>>Hi ,
>>>
>>>It is the first time to send a message to this mailing-list.
>>>
>>>I am trying to execute the test programs in the openais package.
>>>But the programs does not work as expected.
>>>
>>>Please take a look at the followings
>>>
>>>./aisexec
>>>./testamf4
>>>./testamf3
>>> =3D> both HA status are Active
>>>./testamf5
>>>./testamf6
>>> =3D> both are Standby
>>>./testamf1
>>>./testamf2
>>> =3D> both are Standby
>>>
>>>The component in the testamf2 calls a saAmfComponentUnregister function
>>>after calling a saAmfComponentregister.
>>>After that ,testamf5 and testamf6 change status as Active.
>>>But I exepect that both keep Stanby.
>>>It seems that more ACTIVE units than the number defined in group.conf
>>>exist.
>>>
>>>If dsmDisabledUnlockedOutOfServiceCompleted funciton in amf.c
>>>  is changed as following ,programs does work as expected.
>>>
>>>dsmDisabledUnlockedOutOfServiceCompleted( )
>>>{
>>>     .
>>>     .
>>>   group =3D unit->saAmfGroup;
>>>
>>>   /* add 3 lines */
>>>   if ( activeServiceUnitsCount(group) >=3D
>>>group->saAmfActiveUnitsDesired ) {
>>>          retrun;
>>>   }
>>>
>>>   if (servide UnitOutOfService =3D=3D 1 ) {
>>>           log_printf ( LOG ......
>>>      .
>>>      .
>>>}
>>>
>>>If my idea isn't correct ,please tell me what is wrong.
>>>
>>>Thanks.
>>>Miyotaka Sakai
>>>      =

>>>
-------------- next part --------------
diff -Nur openais.2004-08-31.21.30/exec/amf.c openais/exec/amf.c
--- openais.2004-08-31.21.30/exec/amf.c	2004-09-01 13:30:02.000000000 +0900
+++ openais/exec/amf.c	2004-09-05 02:07:11.000000000 +0900
@@ -961,6 +961,7 @@
 	struct list_head *comp_list =3D 0;
 	struct list_head *unit_list =3D 0;
 	int serviceUnitInStandby =3D 0;
+	int activeServiceUnits =3D 0;
 =

 	/*
 	 * Once all components of a service unit are out of service,
@@ -988,6 +989,11 @@
 	}
 =

 	group =3D unit->saAmfGroup;
+	activeServiceUnits =3D activeServiceUnitsCount(group);
+	if (activeServiceUnits>=3Dgroup->saAmfActiveUnitsDesired) {
+		return;
+	}
+
 	if (serviceUnitOutOfService =3D=3D 1) {
 		log_printf (LOG_LEVEL_DEBUG, "SU has gone out of service.\n");
 		/*
diff -Nur openais.2004-08-31.21.30/lib/evs.c openais/lib/evs.c
--- openais.2004-08-31.21.30/lib/evs.c	2004-09-01 13:30:02.000000000 +0900
+++ openais/lib/evs.c	2004-09-05 01:26:15.000000000 +0900
@@ -184,7 +184,7 @@
 	struct message_overlay *dispatch_data;
 	int empty;
 	struct res_header **queue_msg;
-	struct res_header *msg;
+	struct res_header *msg =3D NULL;
 	int ignore_dispatch =3D 0;
 =

 	error =3D saHandleInstanceGet (&evs_handle_t_db, *handle, (void *)&evs_in=
st);
diff -Nur openais.2004-08-31.21.30/test/Makefile openais/test/Makefile
--- openais.2004-08-31.21.30/test/Makefile	2004-09-01 13:30:02.000000000 +0=
900
+++ openais/test/Makefile	2004-09-05 02:01:52.000000000 +0900
@@ -106,7 +106,7 @@
 	$(CC) $(LDFLAGS) -o ckptstress ckptstress.o $(LIBS)
 =

 clean:
-	rm -f *.o testclm testamf testamf1 testamf2 testamf3 testamf4 testamf5 te=
stamf6 testamfth testckpt ckptstress testparse testtimer ckptbench ckptbenc=
hth testevt testevs
+	rm -f *.o testclm testamf testamf1 testamf2 testamf3 testamf4 testamf5 te=
stamf6 testamfth testckpt ckptstress testparse testtimer ckptbench ckptbenc=
hth testevt testevs evsbench
 =

 %.o: %.c
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<


More information about the Openais mailing list