Uploaded image for project: 'Sling'
  1. Sling
  2. SLING-3785

Try to work around repository problems during voting

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • None
    • Discovery Impl 1.0.10
    • Extensions
    • None

    Description

      We've seen race-conditions, where the repository refuses to delete a node, with the following exception:

      16.07.2014 14:58:59.134 *ERROR* [pool-5-thread-5] org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler checkView: encountered a persistence exception during view check: org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4 org.apache.sling.api.resource.PersistenceException: Unable to delete resource at /var/discovery/impl/previousView/4df5cd91-c99c-45d3-9b27-728c6e84f0f4
          at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:491)
          at org.apache.sling.resourceresolver.impl.ResourceResolverImpl.delete(ResourceResolverImpl.java:1044)
          at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.promote(VotingHandler.java:314)
          at org.apache.sling.discovery.impl.cluster.voting.VotingHandler.analyzeVotings(VotingHandler.java:141)
          at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.doCheckView(HeartbeatHandler.java:299)
          at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.checkView(HeartbeatHandler.java:277)
          at org.apache.sling.discovery.impl.common.heartbeat.HeartbeatHandler.run(HeartbeatHandler.java:153)
          at org.apache.sling.commons.scheduler.impl.QuartzJobExecutor.execute(QuartzJobExecutor.java:105)
          at org.quartz.core.JobRunShell.run(JobRunShell.java:207)
          at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
          at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
          at java.lang.Thread.run(Unknown Source)
      Caused by: javax.jcr.ItemNotFoundException: 4f06dc87-401d-44b6-b6da-2e0bff2e2bb6
          at org.apache.jackrabbit.core.ItemManager.getItemData(ItemManager.java:384)
          at org.apache.jackrabbit.core.ItemManager.getNode(ItemManager.java:669)
          at org.apache.jackrabbit.core.NodeImpl.onRemove(NodeImpl.java:696)
          at org.apache.jackrabbit.core.NodeImpl.removeChildNode(NodeImpl.java:624)
          at org.apache.jackrabbit.core.ItemRemoveOperation.perform(ItemRemoveOperation.java:78)
          at org.apache.jackrabbit.core.session.SessionState.perform(SessionState.java:216)
          at org.apache.jackrabbit.core.ItemImpl.perform(ItemImpl.java:91)
          at org.apache.jackrabbit.core.ItemImpl.remove(ItemImpl.java:322)
          at org.apache.sling.jcr.resource.internal.helper.jcr.JcrResourceProvider.delete(JcrResourceProvider.java:486)
          ... 11 more
      

      While this needs to be treated at the repository level, the discovery.impl can help work around this issue by following a tested workaround:

      • when delete fails, try to rename the 'previousview' node to 'previousview_trash_${UUID}'

      Attachments

        Activity

          People

            stefanegli Stefan Egli
            stefanegli Stefan Egli
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: