uvashishtha opened a new pull request, #1236:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1236

   ## What is the purpose of the change
   
   `DefaultValidator` only checks the JobManager/TaskManager memory 
configuration when the spec doesn't set memory. If the spec does set it, a bad 
memory config in `flinkConfiguration` (for example 
`taskmanager.memory.network.max: 32m`, below the default `network.min` of 64m) 
passes validation. The operator then tears down the running cluster and fails 
on redeploy, leaving the deployment stuck in `MISSING`/`UPGRADING`.
   
   We hit this in production and reproduced it on operator 1.16.1.
   
   ## Brief change log
   
   - The validator now always checks the memory configuration, with the spec's 
memory set as the total process memory, the same way `FlinkConfigBuilder` sets 
it on deploy.
   - Added `ResourceConfigUtils#getProcessMemory`, which reads the spec's 
memory with the same `resources`-over-`resource` precedence as 
`FlinkConfigBuilder`. It replaces `isMemoryDefined`.
   - With autoscaler memory tuning enabled, the spec is validated as written, 
not with the autoscaler's tuned memory configuration. A TaskManager memory 
configuration that only deploys with the tuning overrides applied is now 
rejected, since it fails whenever those overrides are absent (first deployment, 
autoscaler reset, or tuning disabled).
   
   ## Verifying this change
   
   Added tests in `DefaultValidatorTest` and `ResourceConfigUtilsTest`. The new 
validator tests fail without the fix. `mvn verify -pl 
flink-kubernetes-operator` passes.
   
   One existing test used a 100 byte TaskManager, which is now rejected since 
it can't deploy; I changed it to 2 GiB.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changes to the `CustomResourceDescriptors`: 
no
     - Core observer or reconciler logic that is regularly executed: yes, 
validation runs on every reconcile
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [x] Yes (Claude Opus 5.5)
   


-- 
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]

Reply via email to