You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/12/12 14:30:01 UTC

[jira] [Commented] (KAFKA-6349) ConcurrentModificationException during streams state restoration

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

ASF GitHub Bot commented on KAFKA-6349:
---------------------------------------

GitHub user dguy opened a pull request:

    https://github.com/apache/kafka/pull/4317

    KAFKA-6349: fix concurrent modification exception in AbstractStateManager during restore

    Fixes a `ConcurrentModificationException` in`AbstractStateManager` that is triggered when a `StateStore` is re-initialized and there are multiple stores in the context.
    
    ### Committer Checklist (excluded from commit message)
    - [ ] Verify design and implementation 
    - [ ] Verify test coverage and CI build status
    - [ ] Verify documentation (including upgrade notes)


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dguy/kafka kafka-6349

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/4317.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #4317
    
----
commit f4a25c9ef0c1cba66b7ac15d7e5b14f28e565c24
Author: Damian Guy <da...@gmail.com>
Date:   2017-12-12T14:28:02Z

    fix concurrent modification exception in AbstractStateManager

----


> ConcurrentModificationException during streams state restoration
> ----------------------------------------------------------------
>
>                 Key: KAFKA-6349
>                 URL: https://issues.apache.org/jira/browse/KAFKA-6349
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 1.1.0
>            Reporter: Damian Guy
>            Assignee: Damian Guy
>            Priority: Blocker
>             Fix For: 1.1.0
>
>         Attachments: streams-error.log
>
>
> During application startup and state restoration a {{ConcurrentModificationException}} was thrown from {{AbstractStateManager}}
> {code}
> [2017-12-12 10:47:09,840] ERROR [streams-saak-test-client-StreamThread-2] stream-thread [streams-saak-test-client-StreamThread-2] Encountered the following error during processing: (org.apache.kafka.streams.processor.internals.StreamThread)
> java.util.ConcurrentModificationException
>         at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:719)
>         at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:752)
>         at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:750)
>         at org.apache.kafka.streams.processor.internals.AbstractStateManager.reinitializeStateStoresForPartitions(AbstractStateManager.java:74)
>         at org.apache.kafka.streams.processor.internals.ProcessorStateManager.reinitializeStateStoresForPartitions(ProcessorStateManager.java:155)
>         at org.apache.kafka.streams.processor.internals.AbstractTask.reinitializeStateStoresForPartitions(AbstractTask.java:229)
>         at org.apache.kafka.streams.processor.internals.StoreChangelogReader.restore(StoreChangelogReader.java:94)
>         at org.apache.kafka.streams.processor.internals.TaskManager.updateNewAndRestoringTasks(TaskManager.java:325)
>         at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:779)
>         at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:750)
>         at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:720)
> {code}
> The root cause is due to an {{OffsetOutOfRangeException}} that causes the store to be re-initialized:
> {code}
> [2017-12-12 10:46:04,861] WARN [streams-saak-test-client-StreamThread-2] stream-thread [streams-saak-test-client-StreamThread-2] Restoring StreamTasks failed. Deleting StreamTasks stores to recreate from scratch. (org.apache.kafka.streams.processor.internals.StoreChangelogReader)
> org.apache.kafka.clients.consumer.OffsetOutOfRangeException: Offsets out of range with no configured reset policy for partitions: {streams-soak-test-app-KSTREAM-AGGREGATE-STATE-STORE-0000000048-changelog-9=0}
>         at org.apache.kafka.clients.consumer.internals.Fetcher.parseCompletedFetch(Fetcher.java:883)
>         at org.apache.kafka.clients.consumer.internals.Fetcher.fetchedRecords(Fetcher.java:528)
>         at org.apache.kafka.clients.consumer.KafkaConsumer.pollOnce(KafkaConsumer.java:1173)
>         at org.apache.kafka.clients.consumer.KafkaConsumer.poll(KafkaConsumer.java:1106)
>         at org.apache.kafka.streams.processor.internals.StoreChangelogReader.restore(StoreChangelogReader.java:84)
>         at org.apache.kafka.streams.processor.internals.TaskManager.updateNewAndRestoringTasks(TaskManager.java:325)
>         at org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:789)
>         at org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:750)
>         at org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:720)
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)