@@ -660,8 +660,9 @@ private NodeAndClient buildNode(int nodeId, long seed, Settings settings,
660660 // we clone this here since in the case of a node restart we might need it again
661661 secureSettings = ((MockSecureSettings ) secureSettings ).clone ();
662662 }
663+ final Settings nodeSettings = finalSettings .build ();
663664 MockNode node = new MockNode (
664- finalSettings . build () ,
665+ nodeSettings ,
665666 plugins ,
666667 nodeConfigurationSource .nodeConfigPath (nodeId ),
667668 forbidPrivateIndexSettings );
@@ -676,7 +677,7 @@ public void afterStart() {
676677 } catch (IOException e ) {
677678 throw new UncheckedIOException (e );
678679 }
679- return new NodeAndClient (name , node , nodeId );
680+ return new NodeAndClient (name , node , nodeSettings , nodeId );
680681 }
681682
682683 private String buildNodeName (int id , Settings settings ) {
@@ -820,15 +821,17 @@ public synchronized void close() {
820821
821822 private final class NodeAndClient implements Closeable {
822823 private MockNode node ;
824+ private final Settings originalNodeSettings ;
823825 private Client nodeClient ;
824826 private Client transportClient ;
825827 private final AtomicBoolean closed = new AtomicBoolean (false );
826828 private final String name ;
827829 private final int nodeAndClientId ;
828830
829- NodeAndClient (String name , MockNode node , int nodeAndClientId ) {
831+ NodeAndClient (String name , MockNode node , Settings originalNodeSettings , int nodeAndClientId ) {
830832 this .node = node ;
831833 this .name = name ;
834+ this .originalNodeSettings = originalNodeSettings ;
832835 this .nodeAndClientId = nodeAndClientId ;
833836 markNodeDataDirsAsNotEligableForWipe (node );
834837 }
@@ -954,7 +957,7 @@ private void recreateNode(final Settings newSettings, final Runnable onTransport
954957 // use a new seed to make sure we have new node id
955958 final long newIdSeed = NodeEnvironment .NODE_ID_SEED_SETTING .get (node .settings ()) + 1 ;
956959 Settings finalSettings = Settings .builder ()
957- .put (node . originalSettings () )
960+ .put (originalNodeSettings )
958961 .put (newSettings )
959962 .put (NodeEnvironment .NODE_ID_SEED_SETTING .getKey (), newIdSeed )
960963 .build ();
0 commit comments