During desired nodes updates the system validates that the provided node settings are valid in order to avoid boot looping issues. If one of the node settings depends on a secure setting, the validation fails even when the secure setting is present and correct.
server/src/test/java/org/elasticsearch/action/admin/cluster/desirednodes/TransportUpdateDesiredNodesActionTests.java
assertThat(desiredNodesMetadata, is(notNullValue()));
        final DesiredNodes desiredNodes = desiredNodesMetadata.getLatestDesiredNodes();
        assertThat(desiredNodes, is(notNullValue()));
        assertThat(desiredNodes.historyID(), is(equalTo(request.getHistoryID())));
        assertThat(desiredNodes.version(), is(equalTo(request.getVersion())));
        assertThat(
            desiredNodes.nodes().stream().map(DesiredNodeWithStatus::desiredNode).toList(),
            containsInAnyOrder(request.getNodes().toArray())
        );
    }
    public void testUpdatesAreIdempotent() {
        final var updateDesiredNodesRequest = randomUpdateDesiredNodesRequest();
        final var latestDesiredNodes = TransportUpdateDesiredNodesAction.updateDesiredNodes(null, updateDesiredNodesRequest);
        final List<DesiredNode> equivalentDesiredNodesList = new ArrayList<>(updateDesiredNodesRequest.getNodes());
        if (randomBoolean()) {
            Collections.shuffle(equivalentDesiredNodesList, random());
        }
        final UpdateDesiredNodesRequest equivalentDesiredNodesRequest = new UpdateDesiredNodesRequest(
            updateDesiredNodesRequest.getHistoryID(),
            updateDesiredNodesRequest.getVersion(),
            equivalentDesiredNodesList,
            updateDesiredNodesRequest.isDryRun()
        );
        assertSame(
            latestDesiredNodes,
            TransportUpdateDesiredNodesAction.updateDesiredNodes(latestDesiredNodes, equivalentDesiredNodesRequest)
        );
    }
    public void testUpdateSameHistoryAndVersionWithDifferentContentsFails() {
        final var updateDesiredNodesRequest = randomUpdateDesiredNodesRequest();