[
https://issues.apache.org/jira/browse/HDDS-8129?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Tsz-wo Sze updated HDDS-8129:
-----------------------------
Description:
In the ContainerStateMachine.submitTask(..) method, we can have the following
case
# The applyTransaction thread enters submitTask(..). It gets a queue Q for a
container C from containerTaskQueues, where Q is empty at that time.
# Right before applyTransaction submits a task T1, the executor has completed
running a previous task T2 for container C. Since Q is empty, the executor
removes Q from containerTaskQueues.
# The applyTransaction thread submits task T1 to Q. It does not aware that Q
is no longer in containerTaskQueues.
# Now, the applyTransaction thread submits a new task T3 for container C.
Since there is no queue for container C in containerTaskQueues, it creates a
new queue Q2 and submits T3 to Q2.
As a result, T1 and T3 for container C can run in parallel since there are two
queues.
was:
In the ContainerStateMachine.submitTask(..) method, we can have the following
case
# The applyTransaction thread enters submitTask(..). It gets a queue Q for a
container C from containerTaskQueues, where Q is empty at that time.
# Right before applyTransaction submits a task T1, the executor has completed
running a previous task T2 for container C. Since Q is empty, so the executor
removes Q from containerTaskQueues.
# The applyTransaction thread submits task T1 to Q. It does not aware Q is
not in containerTaskQueues anymore.
# Now, the applyTransaction thread submits a new task T3 for container C.
Since there is no queue for container C in containerTaskQueues, it creates a
new queue Q2. Then, it submits T3 to Q2.
As a result, T1 and T3 for container C can run in parallel since there are two
queues.
> ContainerStateMachine allows two different tasks with the same container id
> running in parallel
> -----------------------------------------------------------------------------------------------
>
> Key: HDDS-8129
> URL: https://issues.apache.org/jira/browse/HDDS-8129
> Project: Apache Ozone
> Issue Type: Bug
> Components: Ozone Datanode
> Reporter: Tsz-wo Sze
> Assignee: Tsz-wo Sze
> Priority: Blocker
> Labels: pull-request-available
>
> In the ContainerStateMachine.submitTask(..) method, we can have the following
> case
> # The applyTransaction thread enters submitTask(..). It gets a queue Q for a
> container C from containerTaskQueues, where Q is empty at that time.
> # Right before applyTransaction submits a task T1, the executor has
> completed running a previous task T2 for container C. Since Q is empty, the
> executor removes Q from containerTaskQueues.
> # The applyTransaction thread submits task T1 to Q. It does not aware that
> Q is no longer in containerTaskQueues.
> # Now, the applyTransaction thread submits a new task T3 for container C.
> Since there is no queue for container C in containerTaskQueues, it creates a
> new queue Q2 and submits T3 to Q2.
> As a result, T1 and T3 for container C can run in parallel since there are
> two queues.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]