Re: Third server not discovered by second server with LateralTCP

Aaron Smuts <[email protected]> Thu, 9 Jul 2009 06:30:48 -0700 (PDT)
Newsgroups gmane.comp.jakarta.turbine.jcs.devel
Message-ID <[email protected]>
I didn't know about the 3rd server problem.  The issue should be added to J=
IRA=0A=0Ahttps://issues.apache.org/jira/secure/BrowseProject.jspa=0A=0AI th=
ink the problem was in the getInstance method, not the getInstances.  I fix=
ed it.  I'll check it in and cut a temp build soon.=0A=0AIn any case, that =
code needs to change.  I'm making it so that you can have multiple instance=
s of JCS.  There are only a few things left that assume that JCS is a singl=
eton. . . .=0A=0AAaron=0A=0A=0A=0A--- On Thu, 7/9/09, Manuel Cruz <manuelcr=
[email protected]> wrote:=0A=0A> From: Manuel Cruz <[email protected]>=
=0A> Subject: Re: Third server not discovered by second server with Lateral=
TCP=0A> To: [email protected]=0A> Date: Thursday, July 9, 2009, 12=
:58 AM=0A> =0A> Hello Dieter.=0A> =0A> =A0 We look your post in nabble's fo=
rum about "Thirds=0A> erver not discovered by=0A> second server with Latera=
lTCP". We have the same problem=0A> but the solution=0A> you gave (synchron=
ized ( instances ) in method=0A> getInstances() ) not work to=0A> us=A0=A0=
=A0=0A> =0A> =A0 Can you help us ?=A0 =A0 We paste cache.ccf if=0A> you can=
 see it.=0A> =0A> # DEFAULT CACHE REGION=0A> =0A> jcs.default=3DLTCP=0A> jc=
s.default.cacheattributes=3Dorg.apache.jcs.engine.CompositeCacheAttributes=
=0A> jcs.default.cacheattributes.MaxObjects=3D1000=0A> jcs.default.cacheatt=
ributes.MemoryCacheName=3Dorg.apache.jcs.engine.memory.lru.LRUMemoryCache=
=0A> jcs.default.elementattributes.IsEternal=3Dtrue=0A> #jcs.default.elemen=
tattributes.MaxLifeSeconds=3D21600=0A> jcs.default.cacheattributes.UseMemor=
yShrinker=3Dfalse=0A> jcs.default.cacheattributes.ShrinkerIntervalSeconds=
=3D60=0A> jcs.default.cacheattributes.MaxMemoryIdleTimeSeconds=3D360000=0A>=
 jcs.default.elementattributes.IsSpool=3Dfalse=0A> jcs.default.elementattri=
butes.IsRemote=3Dfalse=0A> jcs.default.elementattributes.IsLateral=3Dtrue=
=0A> =0A> =0A> # PRE-DEFINED CACHE REGIONS=0A> =0A> jcs.region.infocorCache=
Lateral=3DLTCP=0A> jcs.region.infocorCacheLateral.cacheattributes=3Dorg.apa=
che.jcs.engine.CompositeCacheAttributes=0A> jcs.region.infocorCacheLateral.=
cacheattributes.MaxObjects=3D1000=0A> jcs.region.infocorCacheLateral.cachea=
ttributes.MemoryCacheName=3Dorg.apache.jcs.engine.memory.lru.LRUMemoryCache=
=0A> jcs.region.infocorCacheLateral.elementattributes.IsEternal=3Dtrue=0A> =
#jcs.region.infocorCacheLateral.elementattributes.MaxLifeSeconds=3D21600=0A=
> jcs.region.infocorCacheLateral.cacheattributes.UseMemoryShrinker=3Dfalse=
=0A> jcs.region.infocorCacheLateral.cacheattributes.ShrinkerIntervalSeconds=
=3D60=0A> jcs.region.infocorCacheLateral.cacheattributes.MaxMemoryIdleTimeS=
econds=3D360000=0A> jcs.region.infocorCacheLateral.elementattributes.IsSpoo=
l=3Dfalse=0A> jcs.region.infocorCacheLateral.elementattributes.IsRemote=3Df=
alse=0A> jcs.region.infocorCacheLateral.elementattributes.IsLateral=3Dtrue=
=0A> =0A> # AVAILABLE AUXILIARY CACHES=0A> =0A> jcs.auxiliary.LTCP=3Dorg.ap=
ache.jcs.auxiliary.lateral.socket.tcp.LateralTCPCacheFactory=0A> jcs.auxili=
ary.LTCP.attributes=3Dorg.apache.jcs.auxiliary.lateral.socket.tcp.TCPLatera=
lCacheAttributes=0A> jcs.auxiliary.LTCP.attributes.TransmissionTypeName=3DT=
CP=0A> jcs.auxiliary.LTCP.attributes.TcpServers=3D192.168.1.176:41000,192.1=
68.196:41000=0A> jcs.auxiliary.LTCP.attributes.TcpListenerPort=3D41100=0A> =
jcs.auxiliary.LTCP.attributes.UdpDiscoveryEnabled=3Dfalse=0A> jcs.auxiliary=
.LTCP.attributes.Receive=3Dtrue=0A> jcs.auxiliary.LTCP.attributes.AllowGet=
=3Dtrue=0A> jcs.auxiliary.LTCP.attributes.IssueRemoveOnPut=3Dtrue=0A> jcs.a=
uxiliary.LTCP.attributes.FilterRemoveByHashCode=3Dfalse=0A> jcs.auxiliary.L=
TCP.attributes.PutOnlyMode=3Dfalse=0A> =0A> =0A> =A0=A0=A0Regards and thank=
 you=A0 =0A> =0A> =0A> =0A> =0A> =0A> =0A> =0A> =0A> =0A> Dieter Laufkoette=
r wrote:=0A> > =0A> > Hello,=0A> > =0A> > we use an net with 3 servers and =
use the LateralTCP=0A> protocol.=0A> > We don=B4t use musticast=0A> (jcs.au=
xiliary.LTCP.attributes.UdpDiscoveryEnabled=0A> > =3D false).=0A> > Each se=
rver is configured the other two servers with=0A> > jcs.auxiliary.LTCP.attr=
ibutes.TcpServers.=0A> > =0A> > At first we start server 1.=0A> > Server 1 =
tries to connect to server 2 and 3.=0A> > =0A> > Then we start server 2.=0A=
> > Server 2 connects to server 1 but does not try to=0A> connect to server=
 3.=0A> > Server 1 connects to server 2=0A> > =0A> > Then we start server 3=
.=0A> > Server 3 connects to server 1 and 2.=0A> > Server 1 connects to ser=
ver 3.=0A> > =0A> > The error:=0A> > Server 2 never tries to connect to ser=
ver 3 and so the=0A> puts of server 2=0A> > never reach server 3.=0A> > =0A=
> > This error occurs with 3 servers on 3 nodes and also=0A> with 3 servers=
 on the=0A> > same node.=0A> > =0A> > =0A> > we found a solution for the pr=
oblem:=0A> > In the class=0A> >=0A> org.apache.jcs.auxiliary.lateral.socket=
.tcp.LateralTCPCacheManager=0A> the Map=0A> > "instances" is synchronised a=
t getInstance() but not=0A> at getInstances(). So=0A> > an inconsistent val=
ue of instances may be got by call=0A> of getInstances().=0A> > The followi=
ng change of getInstances() fixes the=0A> problem:=0A> > =0A> >=A0 =A0=A0=
=A0public Map getInstances()=0A> >=A0 =A0=A0=A0{=0A> >=A0 =A0 =A0 =A0=A0=A0=
synchronized (=0A> instances ) {=0A> >=A0 =A0 =A0 =A0 =A0=0A> =A0=A0=A0retu=
rn instances;=0A> >=A0 =A0 =A0 =A0=A0=A0}=0A> >=A0 =A0=A0=A0}=0A> > =0A> > =
We use new and fast machines, maybe that older and=0A> slower machines does=
=0A> > not produce this synchronisation error.=0A> > =0A> > best regards,=
=0A> > =0A> > Dieter=0A> > =0A> > =0A> > =0A> :-((:-((=0A> -- =0A> View thi=
s message in context: http://www.nabble.com/Third-server-not-discovered-by-=
second-server-with-LateralTCP-tp13855881p24405813.html=0A> Sent from the JC=
S - Dev mailing list archive at=0A> Nabble.com.=0A> =0A> =0A> -------------=
--------------------------------------------------------=0A> To unsubscribe=
, e-mail: [email protected]=0A> For additional command=
s, e-mail: [email protected]=0A> =0A>