| { |
| "stateModel": "LeaderStandby", |
| "minActiveReplica": "2", |
| "numReplica": "3", |
| "testCases": [ |
| { |
| "description": "With pending message, still in the quota range, no throttling", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "-1", |
| "instanceThrottleLoad": "2", |
| "instanceThrottleRecovery": "-1", |
| "partitionNames": ["partition_0", "partition_1"], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| "partition_1": { |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| } |
| }, |
| { |
| "description": "No pending message, instance level throttling will only allow 1 ST happening", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "-1", |
| "instanceThrottleLoad": "1", |
| "instanceThrottleRecovery": "-1", |
| "partitionNames": ["partition_0", "partition_1"], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY", |
| "localhost_12916": "OFFLINE" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "STANDBY" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "OFFLINE" |
| } |
| } |
| }, |
| { |
| "description": "With pending message, only on message allow per instance. Messages to 12915 should be throttled", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "-1", |
| "instanceThrottleLoad": "1", |
| "instanceThrottleRecovery": "-1", |
| "partitionNames": ["partition_0", "partition_1"], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| "partition_1": { |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| } |
| }, |
| { |
| "description": "Throttle happens at resource level with limit 1 and there is a topology change", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "1", |
| "instanceThrottleLoad": "10", |
| "instanceThrottleRecovery": "-1", |
| "partitionNames": ["partition_0", "partition_1"], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| "partition_1": { |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| } |
| }, |
| { |
| "description": "Without pending message, for different priority of partitions, throttle results are different", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "1", |
| "instanceThrottleLoad": "10", |
| "instanceThrottleRecovery": "-1", |
| "partitionNames": ["partition_0", "partition_1"], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "OFFLINE", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE", |
| "localhost_12916": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| } |
| } |
| }, |
| { |
| "description": "Set error threshold, only downward allowed", |
| "clusterThrottleLoad": "-1", |
| "resourceThrottleLoad": "-1", |
| "instanceThrottleLoad": "10", |
| "instanceThrottleRecovery": "-1", |
| "errorThreshold" : "2", |
| "partitionNames": [ |
| "partition_0", |
| "partition_1", |
| "partition_2", |
| "partition_3" |
| ], |
| "messageOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12916": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "preferenceList": { |
| "partition_0": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_1": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_2": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ], |
| "partition_3": [ |
| "localhost_12913", |
| "localhost_12914", |
| "localhost_12915" |
| ] |
| }, |
| "currentStates": { |
| "partition_0": { |
| "localhost_12913": "STANDBY", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY", |
| "localhost_12916": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_2": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_3": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "bestPossible": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_2": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_3": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "STANDBY" |
| } |
| }, |
| "pendingMessages": { |
| }, |
| "expectedOutput": { |
| "partition_0": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY", |
| "localhost_12916": "OFFLINE" |
| }, |
| "partition_1": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "STANDBY", |
| "localhost_12915": "OFFLINE" |
| }, |
| "partition_2": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY" |
| }, |
| "partition_3": { |
| "localhost_12913": "LEADER", |
| "localhost_12914": "ERROR", |
| "localhost_12915": "STANDBY" |
| } |
| } |
| } |
| ] |
| } |