laughingman7743 opened a new pull request, #1221:
URL: https://github.com/apache/flink-kubernetes-operator/pull/1221
## What is the purpose of the change
FLINK-37769 (1.12.0) replaced the boolean `ClusterHealthInfo.healthy` with
`healthResult`. Health info that an operator before 1.12 stored in
`status.clusterInfo` then fails to deserialize after an upgrade to 1.12 or
later (`UnrecognizedPropertyException` on `healthy`).
`ApplicationReconciler.reconcileOtherChanges()` does not catch it, so
missing-deployment recovery, unhealthy-job restarts and the terminal JobManager
cleanup stop for every existing FlinkDeployment, and the stale entry is never
replaced. See FLINK-40991 for details.
This pull request makes the legacy health info readable, so it is replaced
by the next health observation.
## Brief change log
- `ClusterHealthInfo` maps the legacy `healthy` field onto `healthResult`
when deserializing, through a write-only `@JsonProperty("healthy")` setter:
`true` becomes `ClusterHealthResult.healthy()` and `false` becomes
`ClusterHealthResult.error(...)`. Serialization is unchanged.
## Verifying this change
This change added tests and can be verified as follows:
-
`ClusterHealthInfoTest#deserializeWithLegacyHealthyFieldShouldDeserializeCorrectly`:
health info as written by 1.11 deserializes with all fields and a healthy
`healthResult`.
-
`ClusterHealthInfoTest#deserializeWithLegacyUnhealthyFieldShouldBeUnhealthy`: a
legacy `healthy: false` maps to an unhealthy `healthResult`.
- `ClusterHealthInfoTest#serializeShouldNotWriteLegacyHealthyField`:
serializing does not write a top-level `healthy`.
## 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
(reading the stored cluster health info)
## Documentation
- Does this pull request introduce a new feature? no
- If yes, how is the feature documented? not applicable
--
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]