Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-18416

Tests for DistributionZoneManager

    XMLWordPrintableJSON

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:

      1. 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:

      1. node1 is started.
      2. Default zone with <zone config>.

      Test steps:

      1. Start node2.
      2. Assert that data nodes of default zone is [node1, node2] after <scaleUp/commonAutoAdjust> timeout.
      3. Stop node2.
      4. Assert that data nodes of default zone is [node1] after <scaleDown/commonAutoAdjust> timeout.

      Test2:
      Parameters:

      1. zone config: [scaleUp = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]

      Prerequisite:

      1. node1 is started.
      2. Default zone with <zone config>.

      Test steps:

      1. Start node2. (Zone timer is started at node1 and node2).
      2. Restart node1.
      3. Assert that data nodes of default zone is [node1, node2] after node1 is restarted. (Before timer expiration)

      Test3:
      Parameters:

      1. zone config: [scaleDown = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]

      Prerequisite:

      1. node1, node2 are started.
      2. Default zone with <zone config>.
      3. Data nodes of default zone is [node1, node2]

      Test steps:

      1. Stop node2. (Zone timer is started at node1).
      2. Restart node1.
      3. Assert that data nodes of default zone is [node1] after node1 is restarted. (Before timer expiration)

      Test4:
      Prerequisite:

      1. node1 and node2 are started.
      2. Default zone with scaleUp = 10 and scaleDown = Integer.MAX_VALUE.
      3. Data nodes of default zone: [node1, node2].

      Test steps:

      1. Start node3 at the time 0.
      2. Stop node2 at time 5.
      3. Assert that at time 10 data nodes of default zone will be changed to [node1, node2, node3].
      4. Start node4 at time 30.
      5. Assert that at time 40 data nodes of default zone will be changed to [node1, node2, node3, node4].
      6. Start node2 at time 50. (So node2 tries to do metaStorage.invoke with a stale dataNodes [node1, node2, node3])
      7. Assert that data nodes of default zone is [node1, node2, node3, node4] after node2 is restarted.

      Test5:
      Prerequisite:

      1. node1, node2 and node3 are started.
      2. Default zone with scaleUp = 10 and scaleDown = 15.

      Test steps:

      1. Start node4 and stop node2 at the time 0.
      2. Stop node3 and start node5 at the time 5.
      3. Assert that at time 15 data nodes of default zone will be changed to [node1, node2, node3, node4, node5].
      4. Assert that at time 20 data nodes of default zone will be changed to [node1, node4, node5].

      Test6:
      Prerequisite:

      1. node1 and node2 are started.
      2. Default zone with commonAutoAdjust = 10.

      Test steps:

      1. Stop node2 at the time 0.
      2. Start node3 at the time 5.
      3. Assert that at time 10 data nodes of default zone is [node1, node2].
      4. Assert that at time 15 data nodes of default zone will be changed to [node1, node3].

      Zone configuration changes

      Test1:
      Prerequisite:

      1. node1, node2 are started.

      Test steps:

      1. Create new zone.
      2. Assert that data nodes of new zone is [node1, node2]

      Test2:
      Prerequisite:

      1. node1 are started.
      2. Data nodes of default zone: [node1].

      Test steps:

      1. Alter default zone with <[scaleUp = 1000, scaleDown = 0, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]>
      2. Start node2 at time 0.
      3. Change <[scaleUp], [commonAutoAdjust]> to 10 at time 5.
      4. Assert that data nodes of default zone is changed to [node1, node2] at time 15.
      5. Alter default zone with <[scaleUp = 0, scaleDown = 1000, commonAutoAdjust = INTEGER.MAX_VALUE], [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 1000]>
      6. Stop node2 at time 15.
      7. Change <[scaleDown], [commonAutoAdjust]> to 10 at time 20.
      8. Assert that data nodes of default zone is changed to [node1] at time 30.

      Test3:
      Prerequisite:

      1. node1 and node2 are started.

      Test steps:

      1. Alter zone1 with [scaleUp = 10, scaleDown = 10, commonAutoAdjust = INTEGER.MAX_VALUE]
      2. Alter zone2 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 10]
      3. Start node3 and stop node2 at time 0.
      4. Alter zone1 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = INTEGER.MAX_VALUE]
      5. Alter zone2 with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = INTEGER.MAX_VALUE]
      6. Assert that data nodes of default zone is [node1, node2] at time 10.

      Test4:
      Prerequisite:

      1. node1 is started.
      2. Default zone with [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 10]
      3. Data nodes of default zone is [node1].

      Test steps:

      1. Start node2 and then stop node2.
      2. Assert that data nodes of default zone is [node1]. (Timers are not started)

      Test5:
      Prerequisite:

      1. node1, node2 are started.
      2. Zone with data nodes [node1, node2] with [scaleUp = 10, scaleDown = 10, commonAutoAdjust = INTEGER.MAX_VALUE]

      Test steps:

      1. Start node3 and stop node2 at time 0.
      2. Drop zone.
      3. Assert that data nodes of the zone is null. (Timers are canceled)

      Two zones

      Test1:

      1. zone1 config: [scaleUp = 10, scaleDown = 15, commonAutoAdjust = INTEGER.MAX_VALUE]
      2. zone2 config: [scaleUp = INTEGER.MAX_VALUE, scaleDown = INTEGER.MAX_VALUE, commonAutoAdjust = 20]

      Prerequisite:

      1. node1 is started.
      2. Default zone with <zone config>.

      Test steps:

      1. Start node2.
      2. Assert that data nodes of zone1 is [node1, node2] after scaleUp timeout.
      3. Assert that data nodes of zone2 is [node1, node2] after commonAutoAdjust timeout.
      4. Stop node2.
      5. Assert that data nodes of zone1 is [node1] after scaleDown timeout.
      6. Assert that data nodes of zone2 is [node1] after commonAutoAdjust timeout.

      Attachments

        Issue Links

          Activity

            People

              Sergey Uttsel Sergey Uttsel
              Sergey Uttsel Sergey Uttsel
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: