You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Aravindan Vijayan (Jira)" <ji...@apache.org> on 2021/02/05 13:57:00 UTC

[jira] [Assigned] (HDDS-3974) StateContext::addPipelineActionIfAbsent does not work as expected.

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

Aravindan Vijayan reassigned HDDS-3974:
---------------------------------------

    Assignee: Siyao Meng  (was: Aravindan Vijayan)

> StateContext::addPipelineActionIfAbsent does not work as expected.
> ------------------------------------------------------------------
>
>                 Key: HDDS-3974
>                 URL: https://issues.apache.org/jira/browse/HDDS-3974
>             Project: Apache Ozone
>          Issue Type: Bug
>          Components: Ozone Datanode
>    Affects Versions: 1.0.0
>            Reporter: Glen Geng
>            Assignee: Siyao Meng
>            Priority: Minor
>
> {code:java}
> /**
>  * Add PipelineAction to PipelineAction queue if it's not present.
>  *
>  * @param pipelineAction PipelineAction to be added
>  */
> public void addPipelineActionIfAbsent(PipelineAction pipelineAction) {
>   synchronized (pipelineActions) {
>     /**
>      * If pipelineAction queue already contains entry for the pipeline id
>      * with same action, we should just return.
>      * Note: We should not use pipelineActions.contains(pipelineAction) here
>      * as, pipelineAction has a msg string. So even if two msgs differ though
>      * action remains same on the given pipeline, it will end up adding it
>      * multiple times here.
>      */
>     for (InetSocketAddress endpoint : endpoints) {
>       Queue<PipelineAction> actionsForEndpoint =
>           this.pipelineActions.get(endpoint);
>       for (PipelineAction pipelineActionIter : actionsForEndpoint) {
>         if (pipelineActionIter.getAction() == pipelineAction.getAction()
>             && pipelineActionIter.hasClosePipeline() && pipelineAction
>             .hasClosePipeline()
>             && pipelineActionIter.getClosePipeline().getPipelineID()
>             .equals(pipelineAction.getClosePipeline().getPipelineID())) {
>           break;
>         }
>       }
>       actionsForEndpoint.add(pipelineAction);
>     }
>   }
> }
> {code}
> no matter absent or not, pipeline action will be added.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org