From 36e1583e53b2bf65310c518880f6f5f18ce3f8cf Mon Sep 17 00:00:00 2001 From: Abhishek Verma Date: Thu, 16 Feb 2017 16:28:04 -0800 Subject: [PATCH] Revert node replacement behavior so that the framework does not pass -Dcassandra.replace_address if a task fails and restarts Summary: Reverts https://github.com/mesosphere/dcos-cassandra-service/pull/362/files. Reviewers: zhiyan, varung, zjay Subscribers: #cassandraservice Differential Revision: https://code.uberinternal.com/D742838 --- .../dcos/cassandra/common/tasks/CassandraDaemonTask.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cassandra-commons/src/main/java/com/mesosphere/dcos/cassandra/common/tasks/CassandraDaemonTask.java b/cassandra-commons/src/main/java/com/mesosphere/dcos/cassandra/common/tasks/CassandraDaemonTask.java index 1f5a69ac..d0503445 100644 --- a/cassandra-commons/src/main/java/com/mesosphere/dcos/cassandra/common/tasks/CassandraDaemonTask.java +++ b/cassandra-commons/src/main/java/com/mesosphere/dcos/cassandra/common/tasks/CassandraDaemonTask.java @@ -125,11 +125,9 @@ public CassandraDaemonTask create( } private static CassandraConfig updateConfig( - final CassandraMode mode, + final Protos.TaskState state, final CassandraConfig config) { - // If the Cassandra daemon has transitioned to the NORMAL mode, remove the replaceIp so that the next - // time Cassandra starts, it does not have the startup argument -Dcassandra.replace_address=. - if (CassandraMode.NORMAL.equals(mode)) { + if (Protos.TaskState.TASK_RUNNING.equals(state)) { return config.mutable().setReplaceIp("").build(); } else { return config; @@ -218,7 +216,7 @@ public CassandraDaemonTask update(CassandraTaskStatus status) { .setData(getData().updateDaemon( daemonStatus.getState(), daemonStatus.getMode(), - updateConfig(daemonStatus.getMode(), getConfig()) + updateConfig(daemonStatus.getState(), getConfig()) ).getBytes()).build() ); }