Github user serg38 commented on the issue:

    https://github.com/apache/cloudstack/pull/1762
  
    @rafaelweingartner Tried tracing where  deadlock 5 originated. It seems 
both transactions are part of the same method fetchNewPublicIp in 
IpAddressManagerImpl  . Transactions are executed on different management 
servers. 
    Update is triggered through markPublicIpAsAllocated  method 
    
    Select seems to come from there as well  fetchNewPublicIp in 
IpAddressManagerImpl
    
            AssignIpAddressFromPodVlanSearch = 
_ipAddressDao.createSearchBuilder();
            AssignIpAddressFromPodVlanSearch.and("dc", 
AssignIpAddressFromPodVlanSearch.entity().getDataCenterId(), Op.EQ);
            AssignIpAddressFromPodVlanSearch.and("allocated", 
AssignIpAddressFromPodVlanSearch.entity().getAllocatedTime(), Op.NULL);
            SearchBuilder<VlanVO> podVlanSearch = 
_vlanDao.createSearchBuilder();
            podVlanSearch.and("type", podVlanSearch.entity().getVlanType(), 
Op.EQ);
            podVlanSearch.and("networkId", 
podVlanSearch.entity().getNetworkId(), Op.EQ);
            SearchBuilder<PodVlanMapVO> podVlanMapSB = 
_podVlanMapDao.createSearchBuilder();
            podVlanMapSB.and("podId", podVlanMapSB.entity().getPodId(), Op.EQ);
            AssignIpAddressFromPodVlanSearch.join("podVlanMapSB", podVlanMapSB, 
podVlanMapSB.entity().getVlanDbId(), 
AssignIpAddressFromPodVlanSearch.entity().getVlanId(),
                JoinType.INNER);
            AssignIpAddressFromPodVlanSearch.join("vlan", podVlanSearch, 
podVlanSearch.entity().getId(), 
AssignIpAddressFromPodVlanSearch.entity().getVlanId(), JoinType.INNER);
            AssignIpAddressFromPodVlanSearch.done();
    
    public IPAddressVO doInTransaction(TransactionStatus status) throws 
InsufficientAddressCapacityException {
                    StringBuilder errorMessage = new StringBuilder("Unable to 
get ip adress in ");
                    boolean fetchFromDedicatedRange = false;
                    List<Long> dedicatedVlanDbIds = new ArrayList<Long>();
                    List<Long> nonDedicatedVlanDbIds = new ArrayList<Long>();
    
                    SearchCriteria<IPAddressVO> sc = null;
                    if (podId != null) {
                        sc = **AssignIpAddressFromPodVlanSearch**.create();
                        sc.setJoinParameters("podVlanMapSB", "podId", podId);
                        errorMessage.append(" pod id=" + podId);
                    } else {
                        sc = AssignIpAddressSearch.create();
                        errorMessage.append(" zone id=" + dcId);
                    }



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to