Skip to content

Commit

Permalink
ARTEMIS-2715 master broker created w/--replicated should use vote-on-…
Browse files Browse the repository at this point in the history
…replication-failure=true
  • Loading branch information
jbertram authored and clebertsuconic committed Apr 15, 2020
1 parent 71987db commit 35e0ab6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ public class Create extends InputAbstract {
private static final String ETC_LOGIN_CONFIG = "login.config";
private static final String ETC_LOGIN_CONFIG_WITH_GUEST = "etc/login-with-guest.config";
private static final String ETC_LOGIN_CONFIG_WITHOUT_GUEST = "etc/login-without-guest.config";
public static final String ETC_REPLICATED_SETTINGS_TXT = "etc/replicated-settings.txt";
public static final String ETC_REPLICATED_MASTER_SETTINGS_TXT = "etc/replicated-master-settings.txt";
public static final String ETC_REPLICATED_SLAVE_SETTINGS_TXT = "etc/replicated-slave-settings.txt";
public static final String ETC_SHARED_STORE_SETTINGS_TXT = "etc/shared-store-settings.txt";
public static final String ETC_CLUSTER_SECURITY_SETTINGS_TXT = "etc/cluster-security-settings.txt";
public static final String ETC_CLUSTER_SETTINGS_TXT = "etc/cluster-settings.txt";
Expand Down Expand Up @@ -590,7 +591,7 @@ public Object run(ActionContext context) throws Exception {

if (replicated) {
clustered = true;
filters.put("${replicated.settings}", readTextFile(ETC_REPLICATED_SETTINGS_TXT, filters));
filters.put("${replicated.settings}", readTextFile(isSlave() ? ETC_REPLICATED_SLAVE_SETTINGS_TXT : ETC_REPLICATED_MASTER_SETTINGS_TXT, filters));
} else {
filters.put("${replicated.settings}", "");
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

<ha-policy>
<replication>
<master>
<vote-on-replication-failure>true</vote-on-replication-failure>
</master>
</replication>
</ha-policy>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

<ha-policy>
<replication>
<${master-slave}/>
<slave/>
</replication>
</ha-policy>
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ public void testFindStreams() throws Exception {
testStream(Create.class, "etc/" + Create.ETC_BROKER_XML);
testStream(Create.class, "etc/" + Create.ETC_ARTEMIS_ROLES_PROPERTIES);
testStream(Create.class, "etc/" + Create.ETC_ARTEMIS_USERS_PROPERTIES);
testStream(Create.class, Create.ETC_REPLICATED_SETTINGS_TXT);
testStream(Create.class, Create.ETC_REPLICATED_SETTINGS_TXT);
testStream(Create.class, Create.ETC_REPLICATED_MASTER_SETTINGS_TXT);
testStream(Create.class, Create.ETC_REPLICATED_SLAVE_SETTINGS_TXT);
testStream(Create.class, Create.ETC_SHARED_STORE_SETTINGS_TXT);
testStream(Create.class, Create.ETC_CLUSTER_SECURITY_SETTINGS_TXT);
testStream(Create.class, Create.ETC_CLUSTER_SETTINGS_TXT);
Expand Down

0 comments on commit 35e0ab6

Please sign in to comment.