@@ -659,8 +659,9 @@ private NodeAndClient buildNode(int nodeId, long seed, Settings settings,
659659 // we clone this here since in the case of a node restart we might need it again
660660 secureSettings = ((MockSecureSettings ) secureSettings ).clone ();
661661 }
662+ final Settings nodeSettings = finalSettings .build ();
662663 MockNode node = new MockNode (
663- finalSettings . build () ,
664+ nodeSettings ,
664665 plugins ,
665666 nodeConfigurationSource .nodeConfigPath (nodeId ),
666667 forbidPrivateIndexSettings );
@@ -675,7 +676,7 @@ public void afterStart() {
675676 } catch (IOException e ) {
676677 throw new UncheckedIOException (e );
677678 }
678- return new NodeAndClient (name , node , nodeId );
679+ return new NodeAndClient (name , node , nodeSettings , nodeId );
679680 }
680681
681682 private String buildNodeName (int id , Settings settings ) {
@@ -841,15 +842,17 @@ public synchronized void close() {
841842
842843 private final class NodeAndClient implements Closeable {
843844 private MockNode node ;
845+ private final Settings originalNodeSettings ;
844846 private Client nodeClient ;
845847 private Client transportClient ;
846848 private final AtomicBoolean closed = new AtomicBoolean (false );
847849 private final String name ;
848850 private final int nodeAndClientId ;
849851
850- NodeAndClient (String name , MockNode node , int nodeAndClientId ) {
852+ NodeAndClient (String name , MockNode node , Settings originalNodeSettings , int nodeAndClientId ) {
851853 this .node = node ;
852854 this .name = name ;
855+ this .originalNodeSettings = originalNodeSettings ;
853856 this .nodeAndClientId = nodeAndClientId ;
854857 markNodeDataDirsAsNotEligableForWipe (node );
855858 }
@@ -975,7 +978,7 @@ private void recreateNode(final Settings newSettings, final Runnable onTransport
975978 // use a new seed to make sure we have new node id
976979 final long newIdSeed = NodeEnvironment .NODE_ID_SEED_SETTING .get (node .settings ()) + 1 ;
977980 Settings finalSettings = Settings .builder ()
978- .put (node . originalSettings () )
981+ .put (originalNodeSettings )
979982 .put (newSettings )
980983 .put (NodeEnvironment .NODE_ID_SEED_SETTING .getKey (), newIdSeed )
981984 .build ();
0 commit comments