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

Roman Puchkovskiy commented on IGNITE-18170:
--------------------------------------------

It was discovered that, even if we remove the described deadlock by making 
{{updateAssignmentsInternal}} asynchronous (and apply another change to avoid 
problems during startup after a restart), there is still another deadlock 
caused by the following dependency cycle: index waits for its table, table 
waits for RAFT groups to be started, RAFT groups may need to apply some log 
entries during startup (including inserts), and inserts need indices to be 
ready. This could be addressed in IGNITE-18203.

> Deadlock in TableManager#updateAssignmentInternal()
> ---------------------------------------------------
>
>                 Key: IGNITE-18170
>                 URL: https://issues.apache.org/jira/browse/IGNITE-18170
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Roman Puchkovskiy
>            Assignee: Roman Puchkovskiy
>            Priority: Major
>              Labels: ignite-3
>             Fix For: 3.0.0-beta2
>
>         Attachments: threads_report.txt
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently, {{TableManager#updateAssignmentsInternal}} is fully synchronous. 
> The scenario is as follows:
>  # {{updateAssignmentsInternal}} starts a RAFT group for a partition
>  # {{FSMCallerImpl}} finds out that its applied index is below the group 
> committed index, so it starts to apply the missing log entries in its 
> {{init()}} method (this is still done synchronously)
>  # While doing so, it invokes {{{}PartitionListener{}}}, which tries to 
> execute an insert
>  # To make an insert, a PK is needed, so it the insertion code tries to 
> obtain a PK from its future like this: {{pkFuture.join()}}
>  # That future is completed from {{{}IndexManager#createIndexLocally(){}}}, 
> which is invoked by {{ConfigurationNotifier}} later than 
> {{updateassignmentsInternal}} in the same thread
>  # As a result, the PK future cannot be completed before the sync 
> {{updateAssignmentsInternal}} finishes its job and returns, and it cannot 
> finish its job before the PK future is completed
> We should make {{updateAssignmentsInternal}} async.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to