You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Till Rohrmann (Jira)" <ji...@apache.org> on 2020/01/31 10:27:00 UTC
[jira] [Commented] (FLINK-8057) KvStateRegistry#registerKvState may
randomly fail
[ https://issues.apache.org/jira/browse/FLINK-8057?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17027344#comment-17027344 ]
Till Rohrmann commented on FLINK-8057:
--------------------------------------
Are we planning to fix this issue [~kkl0u]? If not, then please unassign and close the issue as won't do.
> KvStateRegistry#registerKvState may randomly fail
> -------------------------------------------------
>
> Key: FLINK-8057
> URL: https://issues.apache.org/jira/browse/FLINK-8057
> Project: Flink
> Issue Type: Improvement
> Components: Runtime / Queryable State
> Affects Versions: 1.4.0
> Reporter: Chesnay Schepler
> Assignee: Kostas Kloudas
> Priority: Major
>
> The {{KvStateRegistry#registerKvState}} method is a bit weird. On each call, a new KvStateID is generated, and we then check whether a state for this ID was already registered. Realistically, this is never the case making the check unnecessary, and on the off-chance that it does happen the job will fail for no good reason.
> {code}
> KvStateID kvStateId = new KvStateID();
> if (registeredKvStates.putIfAbsent(kvStateId, kvState) == null) {
> KvStateRegistryListener listener = this.listener.get();
> if (listener != null) {
> listener.notifyKvStateRegistered(
> jobId,
> jobVertexId,
> keyGroupRange,
> registrationName,
> kvStateId);
> }
> return kvStateId;
> } else {
> throw new IllegalStateException(kvStateId + " is already registered.");
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)