Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Done
-
None
-
None
-
None
-
Docs Required, Release Notes Required
Description
Tests for DistributionZoneManager.
Node start/restart tests:
Test1:
Parameters:
- zone config: [scaleUp = 0, scaleDown = 0, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 0], [scaleUp = 10, scaleDown = 0, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = 0, scaleDown = 10, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 10]
Prerequisite:
- node1 is started.
- Default zone with <zone config>.
Test steps:
- Start node2.
- Assert that data nodes of default zone is [node1, node2] after <scaleUp/commonAutoAdjust> timeout.
- Stop node2.
- Assert that data nodes of default zone is [node1] after <scaleDown/commonAutoAdjust> timeout.
Test2:
Parameters:
- zone config: [scaleUp = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]
Prerequisite:
- node1 is started.
- Default zone with <zone config>.
Test steps:
- Start node2. (Zone timer is started at node1 and node2).
- Restart node1.
- Assert that data nodes of default zone is [node1, node2] after node1 is restarted. (Before timer expiration)
Test3:
Parameters:
- zone config: [scaleDown = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]
Prerequisite:
- node1, node2 are started.
- Default zone with <zone config>.
- Data nodes of default zone is [node1, node2]
Test steps:
- Stop node2. (Zone timer is started at node1).
- Restart node1.
- Assert that data nodes of default zone is [node1] after node1 is restarted. (Before timer expiration)
Test4:
Prerequisite:
- node1 and node2 are started.
- Default zone with scaleUp = 10 and scaleDown = Integer.MAX_VALUE.
- Data nodes of default zone: [node1, node2].
Test steps:
- Start node3 at the time 0.
- Stop node2 at time 5.
- Assert that at time 10 data nodes of default zone will be changed to [node1, node2, node3].
- Start node4 at time 30.
- Assert that at time 40 data nodes of default zone will be changed to [node1, node2, node3, node4].
- Start node2 at time 50. (So node2 tries to do metaStorage.invoke with a stale dataNodes [node1, node2, node3])
- Assert that data nodes of default zone is [node1, node2, node3, node4] after node2 is restarted.
Test5:
Prerequisite:
- node1, node2 and node3 are started.
- Default zone with scaleUp = 10 and scaleDown = 15.
Test steps:
- Start node4 and stop node2 at the time 0.
- Stop node3 and start node5 at the time 5.
- Assert that at time 15 data nodes of default zone will be changed to [node1, node2, node3, node4, node5].
- Assert that at time 20 data nodes of default zone will be changed to [node1, node4, node5].
Test6:
Prerequisite:
- node1 and node2 are started.
- Default zone with commonAutoAdjust = 10.
Test steps:
- Stop node2 at the time 0.
- Start node3 at the time 5.
- Assert that at time 10 data nodes of default zone is [node1, node2].
- Assert that at time 15 data nodes of default zone will be changed to [node1, node3].
Zone configuration changes
Test1:
Prerequisite:
- node1, node2 are started.
Test steps:
- Create new zone.
- Assert that data nodes of new zone is [node1, node2]
Test2:
Prerequisite:
- node1 are started.
- Data nodes of default zone: [node1].
Test steps:
- Alter default zone with <[scaleUp = 1000, scaleDown = 0, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]>
- Start node2 at time 0.
- Change <[scaleUp], [commonAutoAdjust]> to 10 at time 5.
- Assert that data nodes of default zone is changed to [node1, node2] at time 15.
- Alter default zone with <[scaleUp = 0, scaleDown = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]>
- Stop node2 at time 15.
- Change <[scaleDown], [commonAutoAdjust]> to 10 at time 20.
- Assert that data nodes of default zone is changed to [node1] at time 30.
Test3:
Prerequisite:
- node1 and node2 are started.
Test steps:
- Alter zone1 with [scaleUp = 10, scaleDown = 10, commonAutoAdjust = INTEGER.MAX_VALUE]
- Alter zone2 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 10]
- Start node3 and stop node2 at time 0.
- Alter zone1 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = INTEGER.MAX_VALUE]
- Alter zone2 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = INTEGER.MAX_VALUE]
- Assert that data nodes of default zone is [node1, node2] at time 10.
Test4:
Prerequisite:
- node1 is started.
- Default zone with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 10]
- Data nodes of default zone is [node1].
Test steps:
- Start node2 and then stop node2.
- Assert that data nodes of default zone is [node1]. (Timers are not started)
Test5:
Prerequisite:
- node1, node2 are started.
- Zone with data nodes [node1, node2] with [scaleUp = 10, scaleDown = 10, commonAutoAdjust = INTEGER.MAX_VALUE]
Test steps:
- Start node3 and stop node2 at time 0.
- Drop zone.
- Assert that data nodes of the zone is null. (Timers are canceled)
Two zones
Test1:
- zone1 config: [scaleUp = 10, scaleDown = 15, commonAutoAdjust = INTEGER.MAX_VALUE]
- zone2 config: [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 20]
Prerequisite:
- node1 is started.
- Default zone with <zone config>.
Test steps:
- Start node2.
- Assert that data nodes of zone1 is [node1, node2] after scaleUp timeout.
- Assert that data nodes of zone2 is [node1, node2] after commonAutoAdjust timeout.
- Stop node2.
- Assert that data nodes of zone1 is [node1] after scaleDown timeout.
- Assert that data nodes of zone2 is [node1] after commonAutoAdjust timeout.
Attachments
Issue Links
- is a child of
-
IGNITE-17924 Core distributions zones functionality.
- Open