Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Nicholas Walter Knize <[email protected]>
  • Loading branch information
nknize committed Nov 1, 2022
1 parent 3abf9ef commit 254b351
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -324,12 +324,13 @@ public DiscoveryNode(StreamInput in) throws IOException {
for (int i = 0; i < rolesSize; i++) {
final String roleName = in.readString();
final String roleNameAbbreviation = in.readString();
final boolean canContainData = in.readBoolean();
final DiscoveryNodeRole role = roleMap.get(roleName);
if (role == null) {
if (in.getVersion().onOrAfter(Version.V_2_1_0)) {
roles.add(new DiscoveryNodeRole.DynamicRole(roleName, roleNameAbbreviation, in.readBoolean()));
roles.add(new DiscoveryNodeRole.DynamicRole(roleName, roleNameAbbreviation, canContainData));
} else {
roles.add(new DiscoveryNodeRole.UnknownRole(roleName, roleNameAbbreviation, in.readBoolean()));
roles.add(new DiscoveryNodeRole.UnknownRole(roleName, roleNameAbbreviation, canContainData));
}
} else {
assert roleName.equals(role.roleName()) : "role name [" + roleName + "] does not match role [" + role.roleName() + "]";
Expand Down

0 comments on commit 254b351

Please sign in to comment.