lucliu1108 opened a new pull request, #22806:
URL: https://github.com/apache/kafka/pull/22806

   ## Summary
   `MeteredTimestampedWindowStoreWithHeaders` and 
`MeteredSessionStoreWithHeaders` never override `readOnly(IsolationLevel)`. 
Since Kafka Streams' Interactive Query (IQ) path always calls 
`.readOnly(level)` on a store before querying it 
(`CompositeReadOnlyWindowStore.readOnlyStores()`), both classes silently fell 
back to their superclass's generic, headers-ignorant ReadOnlyView/ReadOnlyView 
implementation — which deserializes the key before the value, instead of 
value-first-then-key (the order this feature actually requires, since the key's 
schema-ID header is only recoverable from the value's embedded headers). This 
threw "SerializationException: Error deserializing schema ID / 
IllegalArgumentException: Unknown magic byte!" whenever a headers-aware 
windowed/session store was queried via IQ after a restart+restore.
   
   ## Files changed 
   1. MeteredTimestampedWindowStoreWithHeaders.java
    - Added `readOnly(IsolationLevel)` override + new HeadersReadOnlyView inner 
class — the actual fix.
   2. MeteredSessionStoreWithHeaders.java
    - Same fix: readOnly(IsolationLevel) override + HeadersReadOnlyView inner 
class.
   3. MeteredTimestampedWindowStoreWithHeadersTest.java
    - Added s`houldUseHeadersFromValueToDeserializeKeyInReadOnlyFetchAll` 
   4. MeteredSessionStoreWithHeadersTest.java
    - Added`shouldUseHeadersFromValueToDeserializeKeyInReadOnlyFindSessions` 
test 


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to