You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Mirza Aliev (Jira)" <ji...@apache.org> on 2023/12/22 14:58:00 UTC
[jira] [Comment Edited] (IGNITE-20477) Async component start
[ https://issues.apache.org/jira/browse/IGNITE-20477?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17793630#comment-17793630 ]
Mirza Aliev edited comment on IGNITE-20477 at 12/22/23 2:57 PM:
----------------------------------------------------------------
Please be aware of TODOs with this ticket that were added to the codebase after https://issues.apache.org/jira/browse/IGNITE-20310 was merged
was (Author: maliev):
Please be aware of TODOs with this ticket that was added to the codebase after https://issues.apache.org/jira/browse/IGNITE-20310 was merged
> Async component start
> ---------------------
>
> Key: IGNITE-20477
> URL: https://issues.apache.org/jira/browse/IGNITE-20477
> Project: Ignite
> Issue Type: Task
> Reporter: Aleksandr Polovtcev
> Priority: Major
> Labels: ignite-3
>
> Currently all Ignite components start synchronously (see {{IgniteComponent#start}}). This is inconvenient, because some components can complete their startup only when Meta Storage has initialized all Version Values (see {{IgniteImpl#recoverComponentsStateOnStart}}). Because of this, some components employ a hack which consists of having a "special" Versioned Value, which is injected with a future that gets resolved only after the enclosing component completes its startup (see {{startVv}} in {{TableManager}} or {{IndexManager}}). This blocks the Watch Processor inside Meta Storage, preventing it from processing further updates.
> This problem with this approach that it is quite cryptic and hard to understand. Instead I propose to do the following:
> # Change the signature of {{IgniteComponent#start}} to {{CompletableFuture<Void> start()}}.
> # All actions in the components startup will be divided into two categories: sync actions, that can be executed synchronously in order for the component to be usable by other components during their startup, and async actions, which need to wait for any of the Versioned Values to be initialized by the Meta Storage. Such async actions should be wrapped in a {{CompletableFuture}} and returned from the {{start}} method.
> # {{IgniteImpl}} startup procedure should be updated to collect the futures from all components and wait for their completion inside {{recoverComponentsStateOnStart}}, after {{metaStorageMgr.notifyRevisionUpdateListenerOnStart()}} has been called, but before Watches are deployed ({{metaStorageMgr.deployWatches()}})
--
This message was sent by Atlassian Jira
(v8.20.10#820010)