XComp commented on a change in pull request #19121:
URL: https://github.com/apache/flink/pull/19121#discussion_r829239043
##########
File path:
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/highavailability/KubernetesStateHandleStore.java
##########
@@ -464,13 +465,14 @@ public StringResourceVersion exists(String key) throws
Exception {
* It returns the {@link RetrievableStateHandle} stored under the given
state node if any.
*
* @param key Key to be removed from ConfigMap
- * @return True if the state handle is removed successfully
+ * @return True if the state handle isn't listed anymore.
* @throws Exception if removing the key or discarding the state failed
*/
@Override
public boolean releaseAndTryRemove(String key) throws Exception {
checkNotNull(key, "Key in ConfigMap.");
- final AtomicReference<RetrievableStateHandle<T>> stateHandleRefer =
new AtomicReference<>();
+ final AtomicReference<StateObject> stateHandleRefer = new
AtomicReference<>();
+ final AtomicBoolean stateHandleDoesNotExist = new AtomicBoolean(false);
Review comment:
hmpf, my old answer is gone due to the Github hickups, I guess: I
thought about it once more and couldn't come up with a better approach.
One idea was to avoid having a second atomic reference by using a
`NoOpStateHandle` in case of a non-existing record. This would cause the
downstream callback to go into the `updateConfigMap` call without any changes
to the ConfigMap (due to the remove not really removing something). But this
would have caused an unnecessary `updateConfigMap` call.
I hesitated to go for the approach you suggested in our offline discussion
where we pass this flag in as a return value along the ConfigMap Optional. This
would require further changes in a few other places just to make this method
work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]