[
https://issues.apache.org/jira/browse/FLINK-8777?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16379696#comment-16379696
]
ASF GitHub Bot commented on FLINK-8777:
---------------------------------------
Github user sihuazhou commented on a diff in the pull request:
https://github.com/apache/flink/pull/5578#discussion_r171130718
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/state/TaskLocalStateStoreImpl.java
---
@@ -90,6 +92,9 @@
@GuardedBy("lock")
private boolean disposed;
+ /** Whether to discard the useless state when retrieve local checkpoint
state. */
+ private boolean retrieveWithDiscard = true;
--- End diff --
Aha, this is just for passing the existing test case in
`TaskLocalStateStoreImplTest` ...
```java
private void checkStoredAsExpected(List<TaskStateSnapshot> history, int
off, int len) throws Exception {
for (int i = off; i < len; ++i) {
TaskStateSnapshot expected = history.get(i);
Assert.assertTrue(expected ==
taskLocalStateStore.retrieveLocalState(i));
Mockito.verify(expected,
Mockito.never()).discardState();
}
}
```
> improve resource release when recovery from failover
> ----------------------------------------------------
>
> Key: FLINK-8777
> URL: https://issues.apache.org/jira/browse/FLINK-8777
> Project: Flink
> Issue Type: Improvement
> Components: State Backends, Checkpointing
> Affects Versions: 1.5.0
> Reporter: Sihua Zhou
> Assignee: Sihua Zhou
> Priority: Major
> Fix For: 1.5.0
>
>
> When recovery from failed, {{TaskLocalStateStoreImpl.retrieveLocalState()}}
> will be invoked, we can release all entry from
> {{storedTaskStateByCheckpointID}} that does not satisfy {{entry.checkpointID
> == checkpointID}}, this can prevent the resource leak when job loop in
> {{local checkpoint completed => failed => local checkpoint completed =>
> failed ...}}.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)