Skip to content

Commit 82dc98a

Browse files
ryanemersonahus1
andauthored
Document configuration changes that prevent rolling updates
Closes #41214 Signed-off-by: Ryan Emerson <[email protected]> Signed-off-by: Alexander Schwartz <[email protected]> Co-authored-by: Alexander Schwartz <[email protected]> Co-authored-by: Alexander Schwartz <[email protected]>
1 parent d7273e6 commit 82dc98a

File tree

2 files changed

+69
-15
lines changed

2 files changed

+69
-15
lines changed

docs/guides/server/update-compatibility.adoc

Lines changed: 53 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<@tmpl.guide
66
title="Checking if rolling updates are possible"
77
summary="Execute the update compatibility command to check if {project_name} supports a rolling update for a change in your deployment."
8+
includedOptions="features features-*"
89
>
910
1011
Use the update compatibility command to determine if you can update your deployment with a rolling update strategy when enabling or disabling features or changing the {project_name} version, configurations or providers and themes.
@@ -46,15 +47,7 @@ NOTE: If you do not use `--optimized` keep in mind that an `update` command may
4647
4748
[WARNING]
4849
====
49-
The `check` command currently offers only a limited functionality. At the moment, it takes into consideration only the version of {project_name} and the embedded Infinispan to determine if a rolling update is possible.
50-
If those are unchanged, it reports that a rolling update is possible.
51-
52-
The current version does not yet verify configuration changes and assumes all configuration changes are eligible for a rolling update.
53-
The same applies to changes to custom extensions and themes.
54-
55-
A good use case when to use this is, for example, when you want to do a rolling update when you change the {project_name} theme or your custom extensions, and only want run recreate update when the version of {project_name} changes which does not yet allow a rolling update.
56-
57-
While consumers of these commands should know the limitations that exist today, they should not rely on the internal behavior or the structure of the metadata file.
50+
Consumers of these commands should not rely on the internal behavior or the structure of the metadata file.
5851
Instead, they should rely only on the exit code of the `check` command to benefit from future enhancements on the internal logic to determine when a rolling update is possible.
5952
====
6053
@@ -143,6 +136,46 @@ m|4
143136
The feature `rolling-updates` is disabled.
144137
|===
145138

139+
== Rolling incompatible changes
140+
141+
The following configuration changes return a "Rolling Update is not possible" result code.
142+
143+
=== Features
144+
145+
==== Recreate always
146+
147+
The enabling or disabling of the following features requires a recreate update:
148+
149+
<@showFeaturesRolling ctx.features.updatePolicyShutdown />
150+
151+
152+
==== Recreate on feature version change
153+
154+
Changing the following features versions triggers a recreate update:
155+
156+
<@showFeaturesRolling ctx.features.updatePolicyRollingNoUpgrade />
157+
158+
=== Configuration options
159+
160+
Changing the value of one of the following CLI options triggers a recreate update:
161+
162+
[cols="30%,70%"]
163+
|===
164+
| Option | Rationale
165+
| `--cache` | The `ispn` and `local` configurations are mutually exclusive, changing from one to another will lead to data loss.
166+
| `--cache-config-file` | Changing the configuration file could result in incompatible cache or transport configurations, resulting in clusters not forming as expected.
167+
| `--cache-stack` | Changing stack will result in the cluster not forming during rolling update and will lead to data loss.
168+
| `--cache-embedded-mtls-enabled` | Enabling/Disabling TLS will result in the cluster not forming during rolling update and will lead to data loss.
169+
| `--cache-remote-host` | Connecting to a new remote cache will cause previously cached data to be lost.
170+
| `--cache-remote-port` | Connecting to a new remote cache will cause previously cached data to be lost.
171+
|===
172+
173+
[WARNING]
174+
====
175+
{project_name} does not verify changes to the content of the cache configuration file provided via `--cache-config-file`.
176+
If you change this file, you need to review and test your changes to ensure that nodes using the new configuration can form a cluster with the nodes running the old configuration.
177+
If a cluster cannot be formed, you should shut down {project_name} running the old configuration first before migrating to the new configuration.
178+
====
146179

147180
[[rolling-updates-for-patch-releases]]
148181
== Rolling updates for patch releases
@@ -177,3 +210,14 @@ Known limitations:
177210
The {project_name} Operator uses the functionality described above to determine if a rolling update is possible. See the <@links.operator id="rolling-updates" /> {section} and the `Auto` strategy for more information.
178211

179212
</@tmpl.guide>
213+
214+
<#macro showFeaturesRolling features>
215+
[cols="30%,70%"]
216+
|===
217+
| Feature | Description
218+
219+
<#list features as feature>
220+
| [.features-name]#${feature.versionedKey}# | [.features-description]#${feature.description}#
221+
</#list>
222+
|===
223+
</#macro>

docs/maven-plugin/src/main/java/org/keycloak/guides/maven/Features.java

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99

1010
public class Features {
1111

12-
private List<Feature> features;
12+
private final List<Feature> features;
1313

1414
public Features() {
1515
this.features = Arrays.stream(Profile.Feature.values())
1616
.filter(f -> !f.getType().equals(Profile.Feature.Type.EXPERIMENTAL))
17-
.map(f -> new Feature(f))
17+
.map(Feature::new)
1818
.sorted(Comparator.comparing(Feature::getName))
1919
.collect(Collectors.toList());
2020
}
@@ -35,9 +35,17 @@ public List<Feature> getPreview() {
3535
return features.stream().filter(f -> f.getType().equals(Profile.Feature.Type.PREVIEW)).collect(Collectors.toList());
3636
}
3737

38-
public class Feature {
38+
public List<Feature> getUpdatePolicyShutdown() {
39+
return features.stream().filter(f -> f.profileFeature.getUpdatePolicy() == Profile.FeatureUpdatePolicy.SHUTDOWN).collect(Collectors.toList());
40+
}
41+
42+
public List<Feature> getUpdatePolicyRollingNoUpgrade() {
43+
return features.stream().filter(f -> f.profileFeature.getUpdatePolicy() == Profile.FeatureUpdatePolicy.ROLLING_NO_UPGRADE).collect(Collectors.toList());
44+
}
45+
46+
public static class Feature {
3947

40-
private Profile.Feature profileFeature;
48+
private final Profile.Feature profileFeature;
4149

4250
public Feature(Profile.Feature profileFeature) {
4351
this.profileFeature = profileFeature;
@@ -55,10 +63,12 @@ public String getVersionedKey() {
5563
return profileFeature.getVersionedKey();
5664
}
5765

66+
public String getUpdatePolicy() {
67+
return profileFeature.getUpdatePolicy().toString();
68+
}
69+
5870
private Profile.Feature.Type getType() {
5971
return profileFeature.getType();
6072
}
61-
6273
}
63-
6474
}

0 commit comments

Comments
 (0)