JET-2518: Log keyed-state key and state name on RocksDB migration failures#22
Open
rafael-sotelo wants to merge 1 commit into
Open
JET-2518: Log keyed-state key and state name on RocksDB migration failures#22rafael-sotelo wants to merge 1 commit into
rafael-sotelo wants to merge 1 commit into
Conversation
…lures During savepoint state migration, RocksDBKeyedStateBackend.migrateStateValues iterates raw RocksDB bytes and never decodes the key, so a value deserialization failure logged "key=null" with no state name. Best-effort decode the composite key (key group + key) from the iterator and thread it, plus the state name, into DeserializationContext around the per-entry migrateSerializedValue call (same try/finally pattern as RocksDBValueState.value()). PojoSerializer's failure log now reports [state=<name>, key=<key>], pinpointing the offending entry. Key decoding is best-effort and never masks the real migration failure; migrated bytes are unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
✨ PR Review
LGTM
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Review using Guidelines Learn how
|
🥷 Code experts: kellinwood kellinwood has most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: ✨ Comment |
|
[Automated] Latest version: 2026.6.22-0b48ab5 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a savepoint is restored with an evolved POJO schema, Flink runs state migration:
RocksDBKeyedStateBackend.migrateStateValuesiterates the raw RocksDB bytes, deserializes each value with the old serializer, and re-serializes with the new one. The migration loop never decodes the key (it copiesiterator.key()verbatim) and never callssetCurrentKey, so when a value fails to deserialize,PojoSerializer's error log showskey=nullwith no state name — leaving no way to identify which keyed entry holds the corrupt/incompatible state.This change decodes the composite key during migration and threads it (plus the state name) into
DeserializationContext, so the existingPojoSerializerfailure log now prints[state=<name>, key=<key>].Changes
migrateStateValues, best-effort decode the composite key (key group + key) from each iterator entry using the existingCompositeKeySerializationUtils.migrateSerializedValuecall withDeserializationContext.set(key, stateName)/clear()— the same try/finally pattern used byRocksDBValueState.value().key=nulland never masks the real value-migration failure.Effect
Failure logs change from
Deserialization failure: ...toDeserialization failure [state=<stateName>, key=<realKey>]: ..., pinpointing the offending entry.Verification
flink-statebackend-rocksdbmodule compiles cleanly (./mvnw/ Maven 3.8.6).🤖 Generated with Claude Code
✨ PR Description
Purpose: Enhance RocksDB state migration error diagnostics by logging keyed-state keys and state names during deserialization failures.
Main changes:
Generated by LinearB AI and added by gitStream.
AI-generated content may contain inaccuracies. Please verify before using.
💡 Tip: You can customize your AI Description using Guidelines Learn how