@@ -244,7 +244,6 @@ class Cluster implements Releasable {
244
244
245
245
final List <ClusterNode > clusterNodes ;
246
246
final DeterministicTaskQueue deterministicTaskQueue = new DeterministicTaskQueue (
247
- // TODO does ThreadPool need a node name any more?
248
247
Settings .builder ().put (NODE_NAME_SETTING .getKey (), "deterministic-task-queue" ).build (), random ());
249
248
private boolean disruptStorage ;
250
249
@@ -289,8 +288,13 @@ class Cluster implements Releasable {
289
288
initialNodeCount , masterEligibleNodeIds , initialConfiguration );
290
289
}
291
290
292
- List <ClusterNode > addNodesAndStabilise (int newNodesCount ) {
293
- final List <ClusterNode > addedNodes = addNodes (newNodesCount );
291
+ void addNodesAndStabilise (int newNodesCount ) {
292
+
293
+ // The stabilisation time bound is O(#new nodes) which isn't ideal; it's possible that the real bound is O(1) since node-join
294
+ // events are batched together, but in practice we have not seen problems in this area so have not invested the time needed to
295
+ // investigate this more closely.
296
+
297
+ addNodes (newNodesCount );
294
298
stabilise (
295
299
// The first pinging discovers the master
296
300
defaultMillis (DISCOVERY_FIND_PEERS_INTERVAL_SETTING )
@@ -299,8 +303,6 @@ List<ClusterNode> addNodesAndStabilise(int newNodesCount) {
299
303
// Commit a new cluster state with the new node(s). Might be split into multiple commits, and each might need a
300
304
// followup reconfiguration
301
305
+ newNodesCount * 2 * DEFAULT_CLUSTER_STATE_UPDATE_DELAY );
302
- // TODO Investigate whether 4 publications is sufficient due to batching? A bound linear in the number of nodes isn't great.
303
- return addedNodes ;
304
306
}
305
307
306
308
List <ClusterNode > addNodes (int newNodesCount ) {
@@ -331,7 +333,6 @@ void runRandomly() {
331
333
*/
332
334
void runRandomly (boolean allowReboots , boolean coolDown , long delayVariability ) {
333
335
334
- // TODO supporting (preserving?) existing disruptions needs implementing if needed, for now we just forbid it
335
336
assertThat ("may reconnect disconnected nodes, probably unexpected" , disconnectedNodes , empty ());
336
337
assertThat ("may reconnect blackholed nodes, probably unexpected" , blackholedNodes , empty ());
337
338
@@ -449,11 +450,6 @@ public String toString() {
449
450
deterministicTaskQueue .runRandomTask ();
450
451
}
451
452
}
452
-
453
- // TODO other random steps:
454
- // - reboot a node
455
- // - abdicate leadership
456
-
457
453
} catch (CoordinationStateRejectedException | UncheckedIOException ignored ) {
458
454
// This is ok: it just means a message couldn't currently be handled.
459
455
}
@@ -1254,7 +1250,6 @@ static class AckCollector implements ClusterStatePublisher.AckListener {
1254
1250
1255
1251
@ Override
1256
1252
public void onCommit (TimeValue commitTime ) {
1257
- // TODO we only currently care about per-node acks
1258
1253
}
1259
1254
1260
1255
@ Override
0 commit comments