Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-3282 Expose replication response batching tuning #3566

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@ public static String getDefaultHapolicyBackupStrategy() {
// Number of concurrent workers for a core bridge
public static int DEFAULT_BRIDGE_CONCURRENCY = 1;

private static final int DEFAULT_MAX_REPLICA_RESPONSE_BATCH_BYTES = -1;

/**
* If true then the ActiveMQ Artemis Server will make use of any Protocol Managers that are in available on the classpath. If false then only the core protocol will be available, unless in Embedded mode where users can inject their own Protocol Managers.
*/
Expand Down Expand Up @@ -1721,4 +1723,8 @@ public static String getDefaultTemporaryQueueNamespace() {
public static int getDefaultBridgeConcurrency() {
return DEFAULT_BRIDGE_CONCURRENCY;
}

public static long getDefaultMaxReplicaResponseBatchBytes() {
return DEFAULT_MAX_REPLICA_RESPONSE_BATCH_BYTES;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ public static HAPolicy getHAPolicy(HAPolicyConfiguration conf,
}
case REPLICATED: {
ReplicatedPolicyConfiguration pc = (ReplicatedPolicyConfiguration) conf;
return new ReplicatedPolicy(pc.isCheckForLiveServer(), pc.getGroupName(), pc.getClusterName(), pc.getInitialReplicationSyncTimeout(), server.getNetworkHealthCheck(), pc.getVoteOnReplicationFailure(), pc.getQuorumSize(), pc.getVoteRetries(), pc.getVoteRetryWait(), pc.getQuorumVoteWait(), pc.getRetryReplicationWait());
return new ReplicatedPolicy(pc.isCheckForLiveServer(), pc.getGroupName(), pc.getClusterName(), pc.getInitialReplicationSyncTimeout(), server.getNetworkHealthCheck(), pc.getVoteOnReplicationFailure(), pc.getQuorumSize(), pc.getVoteRetries(), pc.getVoteRetryWait(), pc.getQuorumVoteWait(), pc.getRetryReplicationWait(), pc.getMaxReplicaResponseBatchBytes());
}
case REPLICA: {
ReplicaPolicyConfiguration pc = (ReplicaPolicyConfiguration) conf;
return new ReplicaPolicy(pc.getClusterName(), pc.getMaxSavedReplicatedJournalsSize(), pc.getGroupName(), pc.isRestartBackup(), pc.isAllowFailBack(), pc.getInitialReplicationSyncTimeout(), getScaleDownPolicy(pc.getScaleDownConfiguration()), server.getNetworkHealthCheck(), pc.getVoteOnReplicationFailure(), pc.getQuorumSize(), pc.getVoteRetries(), pc.getVoteRetryWait(), pc.getQuorumVoteWait(), pc.getRetryReplicationWait());
return new ReplicaPolicy(pc.getClusterName(), pc.getMaxSavedReplicatedJournalsSize(), pc.getGroupName(), pc.isRestartBackup(), pc.isAllowFailBack(), pc.getInitialReplicationSyncTimeout(), getScaleDownPolicy(pc.getScaleDownConfiguration()), server.getNetworkHealthCheck(), pc.getVoteOnReplicationFailure(), pc.getQuorumSize(), pc.getVoteRetries(), pc.getVoteRetryWait(), pc.getQuorumVoteWait(), pc.getRetryReplicationWait(), pc.getMaxReplicaResponseBatchBytes());
}
case SHARED_STORE_MASTER: {
SharedStoreMasterPolicyConfiguration pc = (SharedStoreMasterPolicyConfiguration) conf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ public class ReplicaPolicyConfiguration implements HAPolicyConfiguration {

private long retryReplicationWait = ActiveMQDefaultConfiguration.getDefaultRetryReplicationWait();

private long maxReplicaResponseBatchBytes = ActiveMQDefaultConfiguration.getDefaultMaxReplicaResponseBatchBytes();

public ReplicaPolicyConfiguration() {
}

Expand Down Expand Up @@ -180,4 +182,12 @@ public long getRetryReplicationWait() {
public void setRetryReplicationWait(long retryReplicationWait) {
this.retryReplicationWait = retryReplicationWait;
}

public long getMaxReplicaResponseBatchBytes() {
return maxReplicaResponseBatchBytes;
}

public void setMaxReplicaResponseBatchBytes(long maxReplicaResponseBatchBytes) {
this.maxReplicaResponseBatchBytes = maxReplicaResponseBatchBytes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class ReplicatedPolicyConfiguration implements HAPolicyConfiguration {

private Long retryReplicationWait = ActiveMQDefaultConfiguration.getDefaultRetryReplicationWait();

private long maxReplicaResponseBatchBytes = ActiveMQDefaultConfiguration.getDefaultMaxReplicaResponseBatchBytes();

public ReplicatedPolicyConfiguration() {
}

Expand Down Expand Up @@ -139,4 +141,12 @@ public void setRetryReplicationWait(Long retryReplicationWait) {
public Long getRetryReplicationWait() {
return retryReplicationWait;
}

public long getMaxReplicaResponseBatchBytes() {
return maxReplicaResponseBatchBytes;
}

public void setMaxReplicaResponseBatchBytes(long maxReplicaResponseBatchBytes) {
this.maxReplicaResponseBatchBytes = maxReplicaResponseBatchBytes;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1645,6 +1645,10 @@ private ReplicatedPolicyConfiguration createReplicatedHaPolicy(Element policyNod

configuration.setQuorumSize(getInteger(policyNode, "quorum-size", configuration.getQuorumSize(), Validators.MINUS_ONE_OR_GT_ZERO));

configuration.setMaxReplicaResponseBatchBytes(getLong(policyNode, "max-replica-response-batch-bytes",
configuration.getMaxReplicaResponseBatchBytes(),
Validators.MINUS_ONE_OR_GE_ZERO));

return configuration;
}

Expand Down Expand Up @@ -1678,6 +1682,10 @@ private ReplicaPolicyConfiguration createReplicaHaPolicy(Element policyNode) {

configuration.setQuorumSize(getInteger(policyNode, "quorum-size", configuration.getQuorumSize(), Validators.MINUS_ONE_OR_GT_ZERO));

configuration.setMaxReplicaResponseBatchBytes(getLong(policyNode, "max-replica-response-batch-bytes",
configuration.getMaxReplicaResponseBatchBytes(),
Validators.MINUS_ONE_OR_GE_ZERO));

return configuration;
}

Expand Down