Uploaded image for project: 'Flink'
  1. Flink
  2. FLINK-8057

KvStateRegistry#registerKvState may randomly fail

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.4.0
    • None
    • None

    Description

      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.

      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.");
      }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chesnay Chesnay Schepler
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: