You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/05/19 03:23:58 UTC

[GitHub] [flink-kubernetes-operator] wangyang0918 commented on a diff in pull request #223: [hotfix][FLINK-27572] Harden HA meta checking logic

wangyang0918 commented on code in PR #223:
URL: https://github.com/apache/flink-kubernetes-operator/pull/223#discussion_r876561303


##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -245,9 +245,19 @@ public static void deleteJobGraphInKubernetesHA(
     }
 
     public static boolean isHaMetadataAvailable(
-            Configuration conf, KubernetesClient kubernetesClient) {
-        String clusterId = conf.get(KubernetesConfigOptions.CLUSTER_ID);
-        String namespace = conf.get(KubernetesConfigOptions.NAMESPACE);
+            Configuration observeConfig,
+            Configuration deployConfig,
+            KubernetesClient kubernetesClient) {
+
+        if (!FlinkUtils.isKubernetesHAActivated(observeConfig)

Review Comment:
   It is a hard time for me to understand why we are verifying the HA enabled again here. AFAIK, we should already done this in the validator.
   
   After more consideration, I find it is useful in `ApplicationReconciler#getAvailableUpgradeMode`. Maybe we should not mix the HA enabled verification and HA metadata existence. It will also make some logging/exception confusing.



##########
flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/utils/FlinkUtils.java:
##########
@@ -245,9 +245,19 @@ public static void deleteJobGraphInKubernetesHA(
     }
 
     public static boolean isHaMetadataAvailable(
-            Configuration conf, KubernetesClient kubernetesClient) {
-        String clusterId = conf.get(KubernetesConfigOptions.CLUSTER_ID);
-        String namespace = conf.get(KubernetesConfigOptions.NAMESPACE);
+            Configuration observeConfig,
+            Configuration deployConfig,
+            KubernetesClient kubernetesClient) {
+
+        if (!FlinkUtils.isKubernetesHAActivated(observeConfig)

Review Comment:
   It is a hard time for me to understand why we are verifying the HA enabled again here. AFAIK, we should already done this in the validator.
   
   After more consideration, I find it is useful in `ApplicationReconciler#getAvailableUpgradeMode`. Maybe we should not mix the HA enabled verification and HA metadata existence. It will also make some logging/exception confusing.



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org