yuanfenghu created FLINK-38145:
----------------------------------

             Summary: Fix ReflectiveDiffBuilder config comparison to properly 
handle deleted configuration entries
                 Key: FLINK-38145
                 URL: https://issues.apache.org/jira/browse/FLINK-38145
             Project: Flink
          Issue Type: Improvement
          Components: Kubernetes Operator
    Affects Versions: kubernetes-operator-1.12.1
         Environment: flink kubernetes 1.10
            Reporter: yuanfenghu
             Fix For: kubernetes-operator-1.13.0


h2. Problem description

When a configuration item in FlinkDeployment Spec is deleted (such as removing 
a configuration item from FlinkConfiguration), the deleted configuration still 
exists in the running Flink cluster after redeployment and has not been 
properly cleaned up.
h2. The root cause of the problem

lies in the configDiff method of ReflectiveDiffBuilder. java. When comparing 
old and new configurations, this method merges all the keys of the left (old 
configuration) and right (new configuration) maps into a key set for comparison:

 
{code:java}
//代码占位符
Set<String> keys = new HashSet<>();
keys.addAll(left.keySet());
keys.addAll(right.keySet()); {code}
This results in the fact that even if a configuration item is removed in the 
new configuration, it will still be included in the diff comparison and thus 
not correctly recognized as a configuration that needs to be cleaned up.
 
h2. Scope of influence

-All Map type fields annotated with @ SpecDiff. Config
- primarily affecting FlinkDeployment Spec's FlinnConfiguration field
- may result in configuration drift and inconsistent cluster states



 
 



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to