[
https://issues.apache.org/jira/browse/FLINK-12296?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16825138#comment-16825138
]
Stefan Richter commented on FLINK-12296:
----------------------------------------
[~klion26] In general I think it is a good idea to change this and to support
chained operators with keyed state.
I wonder why you would build the paths as
{{../local_state_root_1/allocation_id/job_id/vertex_id_subtask_idx/chk_1*_operator_id*/(state)}}
and not better use
{{../local_state_root_1/allocation_id/job_id/*operator_id*_subtask_idx/chk_1/(state)}}.
[~ningshi] I see, so that reinterpretation was intially introduced by me as
kind of a hidden feature for a very specific case, but seems like it is now
getting used in many different contexts and this also leads to a case that is
breaking the old assumption that only a head operator can have keyed state. I
don't see a downside in just changing the path construction to also make it
work properly with a non-head operators. Until then, workaround should be to
avoid getting the second operator chained.
> Data loss silently in RocksDBStateBackend when more than one operator(has
> states) chained in a single task
> -----------------------------------------------------------------------------------------------------------
>
> Key: FLINK-12296
> URL: https://issues.apache.org/jira/browse/FLINK-12296
> Project: Flink
> Issue Type: Bug
> Components: Runtime / State Backends
> Affects Versions: 1.6.3, 1.6.4, 1.7.2, 1.8.0
> Reporter: Congxian Qiu(klion26)
> Assignee: Congxian Qiu(klion26)
> Priority: Blocker
> Fix For: 1.7.3, 1.9.0, 1.8.1
>
>
> As the mail list said[1], there may be a problem when more than one operator
> chained in a single task, and all the operators have states, we'll encounter
> data loss silently problem.
> Currently, the local directory we used is like below
> ../local_state_root_1/allocation_id/job_id/vertex_id_subtask_idx/chk_1/(state),
>
> if more than one operator chained in a single task, and all the operators
> have states, then all the operators will share the same local
> directory(because the vertext_id is the same), this will lead a data loss
> problem.
>
> The path generation logic is below:
> {code:java}
> // LocalRecoveryDirectoryProviderImpl.java
> @Override
> public File subtaskSpecificCheckpointDirectory(long checkpointId) {
> return new File(subtaskBaseDirectory(checkpointId),
> checkpointDirString(checkpointId));
> }
> @VisibleForTesting
> String subtaskDirString() {
> return Paths.get("jid_" + jobID, "vtx_" + jobVertexID + "_sti_" +
> subtaskIndex).toString();
> }
> @VisibleForTesting
> String checkpointDirString(long checkpointId) {
> return "chk_" + checkpointId;
> }
> {code}
> [1]
> [http://mail-archives.apache.org/mod_mbox/flink-user/201904.mbox/%[email protected]%3E]
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)