[ 
https://issues.apache.org/jira/browse/AMBARI-25614?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

ramkrishna.s.vasudevan updated AMBARI-25614:
--------------------------------------------
    Description: 
While purging the DB, we get the 
{code}
      // find task ids using request stage ids
      Set<Long> taskIds = 
hostRoleCommandDAO.findTaskIdsByRequestStageIds(requestStageIds);
      // find host task ids, to find related host requests and also to remove 
needed host tasks
      final Set<Long> hostTaskIds = findHostTaskIds(taskIds);
      // find host request ids by host task ids to remove later needed host 
requests
      final Set<Long> hostRequestIds = findHostRequestIds(hostTaskIds);
      final Set<Long> topologyRequestIds = 
findTopologyRequestIds(hostRequestIds);
{code}
The hostRequestIds are already got from the topology_host_task table. Those 
hostRequestIds are now used to find the topologyrequestIds. Internally those 
should be got from the topology_logical_request table. But we instead again go 
to the topology_host_task table.

Here what evern toplogyRequestIDs we get do not  match with the actual 
Topology_requests. Hence the delete fails saying no such requestID found. 


  was:
While purging the DB, we get the 
{code}
      // find task ids using request stage ids
      Set<Long> taskIds = 
hostRoleCommandDAO.findTaskIdsByRequestStageIds(requestStageIds);
      // find host task ids, to find related host requests and also to remove 
needed host tasks
      final Set<Long> hostTaskIds = findHostTaskIds(taskIds);
      // find host request ids by host task ids to remove later needed host 
requests
      final Set<Long> hostRequestIds = findHostRequestIds(hostTaskIds);
      final Set<Long> topologyRequestIds = 
findTopologyRequestIds(hostRequestIds);
{code}
The hostRequestIds are already got from the topology_host_task table. Those 
hostRequestIds are now used to find the topologyrequestIds. Internally those 
should be got from the topology_host_request table. But we instead again go to 
the topology_host_task table.

Here what evern toplogyRequestIDs we get do not  match with the actual 
Topology_requests. Hence the delete fails saying no such requestID found. 



> DB purge logic is wrong
> -----------------------
>
>                 Key: AMBARI-25614
>                 URL: https://issues.apache.org/jira/browse/AMBARI-25614
>             Project: Ambari
>          Issue Type: Bug
>            Reporter: ramkrishna.s.vasudevan
>            Priority: Major
>
> While purging the DB, we get the 
> {code}
>       // find task ids using request stage ids
>       Set<Long> taskIds = 
> hostRoleCommandDAO.findTaskIdsByRequestStageIds(requestStageIds);
>       // find host task ids, to find related host requests and also to remove 
> needed host tasks
>       final Set<Long> hostTaskIds = findHostTaskIds(taskIds);
>       // find host request ids by host task ids to remove later needed host 
> requests
>       final Set<Long> hostRequestIds = findHostRequestIds(hostTaskIds);
>       final Set<Long> topologyRequestIds = 
> findTopologyRequestIds(hostRequestIds);
> {code}
> The hostRequestIds are already got from the topology_host_task table. Those 
> hostRequestIds are now used to find the topologyrequestIds. Internally those 
> should be got from the topology_logical_request table. But we instead again 
> go to the topology_host_task table.
> Here what evern toplogyRequestIDs we get do not  match with the actual 
> Topology_requests. Hence the delete fails saying no such requestID found. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to