|
|
@@ -236,6 +236,8 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
+ DEFAULT_ELECTION_DELAY
|
|
|
// perhaps there is an election collision requiring another publication (which times out) and a term bump
|
|
|
+ defaultMillis(PUBLISH_TIMEOUT_SETTING) + DEFAULT_ELECTION_DELAY
|
|
|
+ // very rarely there is another election collision requiring another publication (which times out) and a term bump
|
|
|
+ + defaultMillis(PUBLISH_TIMEOUT_SETTING) + DEFAULT_ELECTION_DELAY
|
|
|
// then wait for the new leader to notice that the old leader is unresponsive
|
|
|
+ (defaultMillis(FOLLOWER_CHECK_INTERVAL_SETTING) + defaultMillis(FOLLOWER_CHECK_TIMEOUT_SETTING)) * defaultInt(
|
|
|
FOLLOWER_CHECK_RETRY_COUNT_SETTING
|
|
|
@@ -1165,6 +1167,7 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
final ClusterSettings clusterSettings = new ClusterSettings(settings, ClusterSettings.BUILT_IN_CLUSTER_SETTINGS);
|
|
|
clusterApplierService = new DisruptableClusterApplierService(
|
|
|
localNode.getId(),
|
|
|
+ localNode.getEphemeralId(),
|
|
|
settings,
|
|
|
clusterSettings,
|
|
|
deterministicTaskQueue,
|
|
|
@@ -1612,6 +1615,7 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
|
|
|
static class DisruptableClusterApplierService extends ClusterApplierService {
|
|
|
private final String nodeName;
|
|
|
+ private final String nodeId;
|
|
|
private final DeterministicTaskQueue deterministicTaskQueue;
|
|
|
private final ThreadPool threadPool;
|
|
|
ClusterStateApplyResponse clusterStateApplyResponse = ClusterStateApplyResponse.SUCCEED;
|
|
|
@@ -1619,6 +1623,7 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
|
|
|
DisruptableClusterApplierService(
|
|
|
String nodeName,
|
|
|
+ String nodeId,
|
|
|
Settings settings,
|
|
|
ClusterSettings clusterSettings,
|
|
|
DeterministicTaskQueue deterministicTaskQueue,
|
|
|
@@ -1626,6 +1631,7 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
) {
|
|
|
super(nodeName, settings, clusterSettings, threadPool);
|
|
|
this.nodeName = nodeName;
|
|
|
+ this.nodeId = nodeId;
|
|
|
this.deterministicTaskQueue = deterministicTaskQueue;
|
|
|
this.threadPool = threadPool;
|
|
|
addStateApplier(event -> {
|
|
|
@@ -1648,7 +1654,7 @@ public class AbstractCoordinatorTestCase extends ESTestCase {
|
|
|
|
|
|
@Override
|
|
|
protected PrioritizedEsThreadPoolExecutor createThreadPoolExecutor() {
|
|
|
- return new MockSinglePrioritizingExecutor(nodeName, deterministicTaskQueue, threadPool);
|
|
|
+ return new MockSinglePrioritizingExecutor(nodeName, nodeId, deterministicTaskQueue, threadPool);
|
|
|
}
|
|
|
|
|
|
@Override
|