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

John Roesler commented on KAFKA-10173:
--------------------------------------

Ok, I'm horrified and embarrassed to report that I know what the problem is, as 
well as the solution. I'll update my PR tomorrow, and I'll re-escalate this 
ticket to a blocker for 2.5.1 and 2.6.0.

In a nutshell, although we have a version number on these changelog records so 
that we can deserialize old formats, I subtly changed the serialization format 
in 2.4.0 without updating the version number, so although the serialization 
format is incompatible between 2.3.1 and 2.5.0, they both claim to be at 
"version 2" (I was mistaken about this before).

This mistake happens to also render the serialization compatibility test I had 
written to be ineffectual.

And I've also just discovered that our system test that covers application 
upgrades had suffered an oversight that made it skip these versions.

Needless to say, in addition to fixing this bug, I'm fixing the serialization 
test to avoid using the same code paths as the application, and I'm also 
revamping the upgrade system test to be sure we'll have a much more robust test 
going forward.

Although this bug was introduced in 2.4.0, I'd still classify it as a blocker, 
since it's so severe (you simply can't upgrade the application until we fix it).

Thanks for the excellently detailed report, and, again, my sincere apologies,

-John

> BufferUnderflowException during Kafka Streams Upgrade
> -----------------------------------------------------
>
>                 Key: KAFKA-10173
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10173
>             Project: Kafka
>          Issue Type: Bug
>          Components: streams
>    Affects Versions: 2.5.0
>            Reporter: Karsten Schnitter
>            Assignee: John Roesler
>            Priority: Major
>              Labels: suppress
>             Fix For: 2.5.1
>
>
> I migrated a Kafka Streams application from version 2.3.1 to 2.5.0. I 
> followed the steps described in the upgrade guide and set the property 
> {{migrate.from=2.3}}. On my dev system with just one running instance I got 
> the following exception:
> {noformat}
> stream-thread [0-StreamThread-2] Encountered the following error during 
> processing:
> java.nio.BufferUnderflowException: null
>       at java.base/java.nio.HeapByteBuffer.get(Unknown Source)
>       at java.base/java.nio.ByteBuffer.get(Unknown Source)
>       at 
> org.apache.kafka.streams.state.internals.BufferValue.extractValue(BufferValue.java:94)
>       at 
> org.apache.kafka.streams.state.internals.BufferValue.deserialize(BufferValue.java:83)
>       at 
> org.apache.kafka.streams.state.internals.InMemoryTimeOrderedKeyValueBuffer.restoreBatch(InMemoryTimeOrderedKeyValueBuffer.java:368)
>       at 
> org.apache.kafka.streams.processor.internals.CompositeRestoreListener.restoreBatch(CompositeRestoreListener.java:89)
>       at 
> org.apache.kafka.streams.processor.internals.StateRestorer.restore(StateRestorer.java:92)
>       at 
> org.apache.kafka.streams.processor.internals.StoreChangelogReader.processNext(StoreChangelogReader.java:350)
>       at 
> org.apache.kafka.streams.processor.internals.StoreChangelogReader.restore(StoreChangelogReader.java:94)
>       at 
> org.apache.kafka.streams.processor.internals.TaskManager.updateNewAndRestoringTasks(TaskManager.java:401)
>       at 
> org.apache.kafka.streams.processor.internals.StreamThread.runOnce(StreamThread.java:779)
>       at 
> org.apache.kafka.streams.processor.internals.StreamThread.runLoop(StreamThread.java:697)
>       at 
> org.apache.kafka.streams.processor.internals.StreamThread.run(StreamThread.java:670)
> {noformat}
> I figured out, that this problem only occurs for stores, where I use the 
> suppress feature. If I rename the changelog topics during the migration, the 
> problem will not occur. 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to