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

ASF GitHub Bot commented on FLINK-9808:
---------------------------------------

tzulitai opened a new pull request #6875: [FLINK-9808] [state backends] Migrate 
state when necessary in state backends
URL: https://github.com/apache/flink/pull/6875
 
 
   ## What is the purpose of the change
   
   This PR adds the procedure of migrating state (i.e., reading state bytes 
with the restored prior serializer, and then re-writing the deserialized object 
with the new serializer).
   
   This should only ever occur in the RocksDB state backend, since the restore 
/ snapshotting of heap-based backends are already a migration process by nature.
   
   The requirement to perform a state migration is decided by the 
`CompatibilityResult` returned from compatibility checks against the new 
serializer using its prior serializer's snapshot.
   
   ## Brief change log
   
   - Add `migrateSerializedValue` to `AbstractRocksDBStateValue`
   - Use the new method to iterate through RocksDB bytes when state migration 
is necessary
   - Remove checks that are no longer relevant in the heap backends, since it 
is inherently already migrating state bytes as part of its restore / snapshot 
process
   - Add a `StateMigrationTestBase` that verifies serializers are being used as 
expected for a restore procedure
   
   ## Verifying this change
   
   The main new test coverage that covers this is in the 
`StateMigrationTestBase` class.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (yes / **no**)
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: (yes / **no**)
     - The serializers: (yes / **no** / don't know)
     - The runtime per-record code paths (performance sensitive): (**yes** / no 
/ don't know)
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Yarn/Mesos, ZooKeeper: (**yes** / no / don't know)
     - The S3 file system connector: (yes / **no** / don't know)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (**yes** / no)
     - If yes, how is the feature documented? (**not yet documented**)

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Implement state conversion procedure in state backends
> ------------------------------------------------------
>
>                 Key: FLINK-9808
>                 URL: https://issues.apache.org/jira/browse/FLINK-9808
>             Project: Flink
>          Issue Type: Sub-task
>          Components: State Backends, Checkpointing
>            Reporter: Tzu-Li (Gordon) Tai
>            Assignee: Aljoscha Krettek
>            Priority: Critical
>              Labels: pull-request-available
>             Fix For: 1.7.0
>
>
> With FLINK-9377 in place and that config snapshots serve as the single source 
> of truth for recreating restore serializers, the next step would be to 
> utilize this when performing a full-pass state conversion (i.e., read with 
> old / restore serializer, write with new serializer).
> For Flink's heap-based backends, it can be seen that state conversion 
> inherently happens, since all state is always deserialized after restore with 
> the restore serializer, and written with the new serializer on snapshots.
> For the RocksDB state backend, since state is lazily deserialized, state 
> conversion needs to happen for per-registered state on their first access if 
> the registered new serializer has a different serialization schema than the 
> previous serializer.
> This task should consist of three parts:
> 1. Allow {{CompatibilityResult}} to correctly distinguish between whether the 
> new serializer's schema is a) compatible with the serializer as it is, b) 
> compatible after the serializer has been reconfigured, or c) incompatible.
> 2. Introduce state conversion procedures in the RocksDB state backend. This 
> should occur on the first state access.
> 3. Make sure that all other backends no longer do redundant serializer 
> compatibility checks. That is not required because those backends always 
> perform full-pass state conversions.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to