You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Keith Wall (JIRA)" <ji...@apache.org> on 2016/04/21 17:55:25 UTC

[jira] [Comment Edited] (QPID-7197) Prevent deletion of objects that are in use

    [ https://issues.apache.org/jira/browse/QPID-7197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15240800#comment-15240800 ] 

Keith Wall edited comment on QPID-7197 at 4/21/16 3:55 PM:
-----------------------------------------------------------

I think that we would want to enforce this using generic code built into ACO.

The algorithm needs to search the configured object tree for other objects that have attributes that refer to the object that is about to be deleted.  If a matching object is found, the delete must be aborted with a useful error message.

The algorithm needs to be sufficiently smart to cater for attributes that are collections (or maps) whose generic parameterised types are configured objects.  Fields that are not attributes must not be considered.

The search algorithm needs to respect the discontinuities within the model.  That is when deleting an object within the Broker's part of the model, the search must not descend into the virtualhosts or beyond.  Similarly, when deleting a object beneath a virtualhost, the must not ascend back into the Broker or sibling virtualhosts.  This is safe (for the moment) as we know the Broker's children never refer to children of Virtualhost and vice versa.  This avoids the need to lock the whole model whilst a delete is processed.  (It is likely this will change once Federation is implemented - but this can wait).

If deleting a object that has children and the delete cascades, we need to apply the check to the children too.  (Check Queue/Exchange/Bindings).






was (Author: k-wall):
I think that we would want to enforce this using generic code built into ACO.

The algorithm needs to search the configured object tree for other objects that have attributes that refer to the object that is about to be deleted.  If a matching object is found, the delete must be aborted with a useful error message.

The algorithm needs to be sufficiently smart to cater for attributes that are collections (or maps) whose generic parameterised types are configured objects.  Fields that are not attributes must not be considered.

The search algorithm needs to respect the discontinuities within the model.  That is when deleting an object within the Broker's part of the model, the search must not descend into the virtualhosts or beyond.  Similarly, when deleting a object beneath a virtualhost, the must not ascend back into the Broker or sibling virtualhosts.  This is safe (for the moment) as we know the Broker's children never refer to children of Virtualhost and vice versa.  This avoids the need to lock the whole model whilst a delete is processed.  (It is likely this will change once Federation is implemented - but this can wait).

If deleting a object that has children and the delete cascades, we need to apply the check to the children too.  (Check Queue/Exchange/Bindings).






The search algorithm does not need to traverse the discontinuities in the model as we currently have don't require 


 


    locate the tree top
    traverse the tree checking to see if the object that is about to be deleted is in use. Do this by:
        checking each child's managed attributes
        for each attribute if the managed attributes type matches the delete target, check whether it refers to the same object



> Prevent deletion of objects that are in use
> -------------------------------------------
>
>                 Key: QPID-7197
>                 URL: https://issues.apache.org/jira/browse/QPID-7197
>             Project: Qpid
>          Issue Type: Improvement
>          Components: Java Broker
>            Reporter: Keith Wall
>             Fix For: qpid-java-6.1
>
>
> Enhance the facilities of the CO framework to prevent the deletion of the objects that are in use elsewhere in the model.  Specifically this means searching for other COs that have an attribute that refers to the object that is about to be deleted,.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org