On Wed, Feb 1, 2012 at 2:34 AM, Senaka Fernando <[email protected]> wrote: > Hi Shankar, > > I believe that we got the wrong impression out of this discussion. What I > initially suggested is that Pradeeban check whether caching is properly > setup. > > If no distributed/replicated caching is available, the result is cached > locally in each node (the two nodes don't communicate with each other), and > even if you delete from the one side the other side will not know that since > the caches are not replicated (and the second node won't invalidate its copy > due to this reason). The second node will realize that the resource is gone > only when the cache timesouts.
I agree with your above comment. But the question was why ResourceNotFoundException thrown when resourceExists() is true. If a resource is cached locally in one node, will configRegistry.resourceExists(serviceResourcePath) return true and resource = configRegistry.get(serviceResourcePath) throw exception? cache invalidation can't be the issue, because in the code Pradeeban shared, when the exception is thrown, he is again doing a test of configRegistry.resourceExists(serviceResourcePath). Shankar > > Thanks, > Senaka. > > > On Tue, Jan 31, 2012 at 9:47 AM, Selvaratnam Uthaiyashankar > <[email protected]> wrote: >> >> Hi Senaka, >> >> Does that mean, configRegistry.resourceExists(serviceResourcePath) >> takes from cache and resource = >> configRegistry.get(serviceResourcePath); takes from database? That >> doesn't sound right to me. If this is the case, why we are caching >> only the path, but not the resource? >> >> If above two succeed when the resource is not actually in the >> database, or above two failed when the resource is in the database, >> then it is due to the caching. If one of the above succeed and the >> other fails, then we need to fix it. >> >> Shankar >> >> On Sun, Jan 29, 2012 at 3:10 PM, Senaka Fernando <[email protected]> wrote: >> > Hi Dimuthu, >> > >> > Well that probably explains my point. If you test something across two >> > nodes >> > you need to turn off caching in registry or properly setup distributed >> > or >> > replicated caching. If not each node caches locally, and will not sync >> > until >> > timeout. >> > >> > Thanks, >> > Senaka. >> > >> > >> > On Thursday, January 26, 2012, Dimuthu Leelarathne <[email protected]> >> > wrote: >> >> Hi Senaka, >> >> >> >> On Thu, Jan 26, 2012 at 5:26 AM, Senaka Fernando <[email protected]> >> >> wrote: >> >>> >> >>> Hi Pradeeban, >> >>> >> >>> Probably, due to caching not properly setup. >> >>> >> >> >> >> AFAIK registry reads from database when it is not in the cache. From my >> >> experience Registry worked perfectly when multicasting ports were >> >> closed in >> >> the switch as well. >> >> >> >> thanks, >> >> dimuthu >> >> >> >>> >> >>> Thanks, >> >>> Senaka. >> >>> >> >>> On Wed, Jan 25, 2012 at 11:39 PM, Kathiravelu Pradeeban >> >>> <[email protected]> wrote: >> >>> >> >>> The deployment was with the SVN based deployment synchronizer. Ghost >> >>> deployer is disabled. >> >>> >> >>> Regards, >> >>> Pradeeban. >> >>> >> >>> On Wed, Jan 25, 2012 at 7:43 PM, Kathiravelu Pradeeban >> >>> <[email protected]> wrote: >> >>> >> >>> Hi, >> >>> Azeez and I were testing a Stratos deployment with 2 nodes of >> >>> Appserver. >> >>> We did a minor modification in the getService() of >> >>> ServicePersistenceManager >> >>> as below. >> >>> >> >>> Then we uploaded a service; accessed it from two browsers; and deleted >> >>> it. >> >>> Interestingly the highlighted code-segment is executed, and prints >> >>> true, >> >>> in the terminal of the other node. >> >>> >> >>> That means, the resourceExists, but the ResourceNotFoundException is >> >>> thrown. Can someone explains this behavior? >> >>> >> >>> >> >>> public Resource getService(AxisService axisService) throws >> >>> Exception >> >>> { >> >>> try { >> >>> String serviceResourcePath = >> >>> PersistenceUtils.getResourcePath(axisService); >> >>> if (configRegistry.resourceExists(serviceResourcePath)) { >> >>> Resource resource = null; >> >>> try { >> >>> resource = >> >>> configRegistry.get(serviceResourcePath); >> >>> } catch (ResourceNotFoundException e) { >> >>> >> >>> System.out.println("++++++++++++++++++++++++++++++++++" + >> >>> configRegistry.resourceExists(serviceResourcePath)); >> >>> >> >>> if(configRegistry.resourceExists(serviceResourcePath)){ >> >>> throw e; >> >>> } >> >>> } >> >>> .... >> >>> >> >>> } >> >>> >> >>> >> >>> Complete log for the interested: >> >>> Node 1: >> >>> [2012-01-25 05:52:04,562] @3000.abw [6451] [WSO2 Stratos Application >> >>> Server] INFO {org.wso2.carbon.service.mgt.ServiceAdmin} - Undeploying >> >>> Web >> >>> service: >> >>> >> >>> /mnt/209.126.198.68/wso2stratos-as-1.5.2/repository/tenants/6451/axis2services/Chad.aar >> >>> [2012-01-25 05:52:10,101] INFO >> >>> {org.apache.axis2.deployment.DeploymentEngine} - >> >>> org.apache.axis2.deployment.DeploymentException: The Chad service >> >>> group name >> >>> is not valid. >> >>> >> >>> >> >>> Node2: >> >>> ++++++++++++++++++++++++++++++++++true >> >>> [2012-01-25 05:51:57,467] @3000.abw [6451] [WSO2 Stratos Application >> >>> Server]ERROR >> >>> {org.wso2.carbon.core.persistence.AbstractPersistenceManager} >> >>> - Could not get the Service resource from Config Registry >> >>> org.wso2.carbon.registry.core.exceptions.ResourceNotFoundException: >> >>> Resource does not exist at path >> >>> /_system/config/repository/axis2/service-groups/Chad/services/Chad >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.jdbc.handlers.builtin.MountHandler.get(MountHandler.java:426) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.jdbc.handlers.HandlerManager.get(HandlerManager.java:2378) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.jdbc.handlers.UserDefinedHandlerManager.get(UserDefinedHandlerManager.java:200) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.jdbc.handlers.HandlerLifecycleManager.get(HandlerLifecycleManager.java:814) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.jdbc.EmbeddedRegistry.get(EmbeddedRegistry.java:512) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.caching.CacheBackedRegistry.get(CacheBackedRegistry.java:133) >> >>> at >> >>> >> >>> org.wso2.carbon.registry.core.session.UserRegistry.get(UserRegistry.java:528) >> >>> at >> >>> >> >>> org.wso2.carbon.core.persistence.ServicePersistenceManager.getService(ServicePersistenceManager.java:89) >> >>> at >> >>> >> >>> org.wso2.carbon.core.deployment.DeploymentInterceptor.serviceUpdate(DeploymentInterceptor.java:254) >> >>> at >> >>> >> >>> org.apache.axis2.engine.AxisConfiguration.notifyObservers(AxisConfiguration.java:652) >> >>> at >> >>> >> >>> org.apache.axis2.engine.AxisConfiguration.removeServiceGroup(AxisConfiguration.java:516) >> >>> at >> >>> >> >>> org.apache.axis2.deployment.ServiceDeployer.undeploy(ServiceDeployer.java:188) >> >>> >> >>> >> >>> _______________________________________________ >> >>> Carbon-dev mailing list >> >>> [email protected] >> >>> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev >> >>> >> >> >> >> >> >> >> >> -- >> >> Dimuthu Leelarathne >> >> Technical Lead >> >> >> >> WSO2, Inc. (http://wso2.com) >> >> email: [email protected] >> >> >> >> Lean . Enterprise . Middleware >> >> >> > >> > -- >> > Senaka Fernando >> > Product Manager - WSO2 Governance Registry; >> > Associate Technical Lead; WSO2 Inc.; http://wso2.com >> > Member; Apache Software Foundation; http://apache.org >> > >> > E-mail: senaka AT wso2.com >> > P: +1 408 754 7388; ext: 51736; M: +94 77 322 1818 >> > Linked-In: http://linkedin.com/in/senakafernando >> > >> > Lean . Enterprise . Middleware >> > >> > >> > _______________________________________________ >> > Carbon-dev mailing list >> > [email protected] >> > http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev >> > >> >> >> >> -- >> S.Uthaiyashankar >> Senior Architect & Senior Manager >> WSO2 Inc. >> http://wso2.com/ - "lean . enterprise . middleware" >> >> Phone: +94 714897591 >> _______________________________________________ >> Carbon-dev mailing list >> [email protected] >> http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev > > > > > -- > Senaka Fernando > Product Manager - WSO2 Governance Registry; > Associate Technical Lead; WSO2 Inc.; http://wso2.com > Member; Apache Software Foundation; http://apache.org > > E-mail: senaka AT wso2.com > P: +1 408 754 7388; ext: 51736; M: +94 77 322 1818 > Linked-In: http://linkedin.com/in/senakafernando > > Lean . Enterprise . Middleware > > > _______________________________________________ > Carbon-dev mailing list > [email protected] > http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev > -- S.Uthaiyashankar Senior Architect & Senior Manager WSO2 Inc. http://wso2.com/ - "lean . enterprise . middleware" Phone: +94 714897591 _______________________________________________ Carbon-dev mailing list [email protected] http://mail.wso2.org/cgi-bin/mailman/listinfo/carbon-dev
