janchilling commented on PR #18752: URL: https://github.com/apache/kafka/pull/18752#issuecomment-2651798144
Hi @aliehsaeedii, Thank you for your response. During both restarting and scaling out, the `GlobalStreamThread` invokes the `GlobalStateUpdateTask.initialize()` method using `GlobalStateMaintainer` to properly restore the global state. Ref - https://github.com/apache/kafka/blob/trunk/streams/src/main/java/org/apache/kafka/streams/processor/internals/GlobalStreamThread.java#L244 And later as part of this process, either the `reprocessState` or `restoreState` methods will be executed, depending on the scenario: - `restoreState` is called when simply reloading state. - `reprocessState` is used when the global state needs to be reprocessed. Additionally, the reason this logic is implemented in the `GlobalStateUpdateTask` class is to basically reuse the existing `flushState` method . Let me know if you have any questions or if further clarification is needed! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org