[ 
https://issues.apache.org/jira/browse/IGNITE-19602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Mirza Aliev updated IGNITE-19602:
---------------------------------
    Epic Link: IGNITE-19743  (was: IGNITE-19577)

> API and tests for causality data nodes in DistributionZoneManager
> -----------------------------------------------------------------
>
>                 Key: IGNITE-19602
>                 URL: https://issues.apache.org/jira/browse/IGNITE-19602
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Sergey Uttsel
>            Assignee: Sergey Uttsel
>            Priority: Major
>              Labels: ignite-3
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> h3. *Motivation*
> In https://issues.apache.org/jira/browse/IGNITE-19506 we will create 
> implementation for getting data nodes from zone manager with causality token. 
> In this ticket we need to create API, test plan and implement tests with test 
> infrastructure.
> h3. *Definition of Done*
> API and tests for causality data nodes in DistributionZoneManager are 
> implemented.
>  
> *Test plan*
> *Test1* (Not implemented because it assumes that we will use versioned value. 
> For now we are not going to use a versioned value)
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> Test steps:
> 1. Get versionedDataNodes future with zoneId=1, revision 6.
> 2. Check this future is not completed.
> 3. Create a metastorage event with revision==6 which is not related to a 
> logical topology changing.
> 4. Check that the future is completed with [nodeA, nodeB].
> 5. Get versionedDataNodes future with zoneId=1, revision 6 another time.
> 6. Check that the future is completed.
> Check the same test but with a configuration event.
> Check this test case for a zone with immediate and not immediate timers, 
> default and custom zones.
> *Test2* topologyLeapUpdate
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> 2. zonesByRevision contains [revision=5, zoneId==2 -> [nodeA, nodeB]]
> 3. A zone1 with immediate scaleUp and immediate scaleDown.
> 4. A zone2 with scaleUp=1 and scaleDown=1 timers.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Invoke `fut2=versionedDataNodes(zoneId=2, revision=6)`
> 3. Check that `!fut1.isDone()`.
> 4. Check that `!fut2.isDone()`.
> 5. Change topology to [nodeA, nodeC]. Topology revision is 6.
> 6. assertThat(fut1, willSucceedFast())
> 7. assertThat(fut2, willSucceedFast())
> 8. Check that fut1 is completed with [nodeA, nodeC]
> 9. Check that fut2 is completed with [nodeA, nodeB].
> 10. Wait when data nodes for zone2 is updated in the metastorage (with 
> revision x).
> 11. Invoke `fut3=versionedDataNodes(zoneId=2, revision=x)`
> 12. Check that fut3 is completed with [nodeA, nodeC].
> Check this test case for a zone with default and custom zones.
> *Test3* topologyLeapUpdateScaleUpNotImmediateAndScaleDownImmediate
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> 4. A zone1 with scaleUp=1 and scaleDown=immediate timers.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA, nodeC]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast())
> 5. Check that fut1 is completed with [nodeA, nodeB, nodeC].
> 6. Wait when data nodes for zone2 is updated in the metastorage (with 
> revision x).
> 7. Invoke `fut2=versionedDataNodes(zoneId=1, revision=x)`
> 8. Check that fut2 is completed with [nodeA, nodeC].
> Check this test case for a zone with default and custom zone.
> *Test4* topologyLeapUpdateScaleUpImmediateAndScaleDownNotImmediate
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> 2. A zone1 with scaleUp=immediate and scaleDown=1 timers.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA, nodeC]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast())
> 5. Check that fut1 is completed with [nodeA].
> 6. Wait when data nodes for zone1 is updated in the metastorage (with 
> revision x).
> 7. Invoke `fut2=versionedDataNodes(zoneId=1, revision=x)`
> 8. Check that fut2 is completed with [nodeA, nodeC].
> Check this test case for a zone with default and custom zone.
> *Test5* (Change scaleUp to immediate) dataNodesUpdatedAfterScaleUpChanged
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA]]
> 2. A zone1 with scaleUp=10000 timer and immediate scaleDown timer.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA, nodeB]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast()) with [nodeA].
> 5. Change scaleUp to immediate. The configuration change revision is 7.
> 6. Invoke `fut2=versionedDataNodes(zoneId=1, revision=6)`. Check that fut2 is 
> completed with [nodeA].
> 7. Invoke `fut3=versionedDataNodes(zoneId=1, revision=7)`. Check that fut3 is 
> completed with [nodeA, nodeB].
> Check this test case for a zone with default and custom zone.
> *Test6* (Change scaleDown to immediate) dataNodesUpdatedAfterScaleDownChanged
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> 2. A zone1 with immediate scaleUp timer and scaleDown=10000.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast()) with [nodeA, nodeB].
> 5. Change scaleDown to immediate. The configuration change revision is 7.
> 6. Invoke `fut2=versionedDataNodes(zoneId=1, revision=6)`. Check that fut2 is 
> completed with [nodeA, nodeB].
> 7. Invoke `fut3=versionedDataNodes(zoneId=1, revision=7)`. Check that fut3 is 
> completed with [nodeA].
> Check this test case for a zone with default and custom zone.
> *Test7* (drop zone) scheduleScaleUpTaskThenDropZone
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA]]
> 2. A zone1 with scaleUp=10000 timer and immediate scaleDown timer.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA, nodeB]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast()) with [nodeA].
> 5. Drop the zone. The drop event revision is 7.
> 6. Invoke `fut2=versionedDataNodes(zoneId=1, revision=6)`. Check that fut2 is 
> completed with [nodeA].
> 7. Invoke `fut3=versionedDataNodes(zoneId=1, revision=7)`. Check that fut3 is 
> completed with exception DistributionZoneNotFoundException.
> Check this test case for a zone with default and custom zone.
> *Test8* (drop zone) scheduleScaleDownTaskThenDropZone
> Prerequisite:
> 1. zonesByRevision contains [revision=5, zoneId==1 -> [nodeA, nodeB]]
> 2. A zone1 with immediate scaleUp timer and scaleDown=10000 timer.
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that `!fut1.isDone()`.
> 3. Change topology to [nodeA]. Topology revision is 6.
> 4. assertThat(fut1, willSucceedFast()) with [nodeA, nodeB].
> 5. Drop the zone. The drop event revision is 7.
> 6. Invoke `fut2=versionedDataNodes(zoneId=1, revision=6)`. Check that fut2 is 
> completed with [nodeA, nodeB].
> 7. Invoke `fut3=versionedDataNodes(zoneId=1, revision=7)`. Check that fut3 is 
> completed with exception DistributionZoneNotFoundException.
> Check this test case for a zone with default and custom zone.
> *Test 9* createThenDropZone
> Prerequisite:
> 1. The last applied revision is 6.
> 2. The zone with zoneId=1 is not created.
> 3. Current topology: [nodeA, nodeB].
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=1, revision=6)`
> 2. Check that fut1 is completed exceptionally with 
> DistributionZoneNotFoundException.
> 3. Create zone with zoneId=1. A create zone revision is 7.
> 4. Invoke `fut2=versionedDataNodes(zoneId=1, revision=7)`
> 5. Check that fut2 is completed with current topology data nodes.
> 6. Drop zone with zoneId=1. A drop zone revision is 8.
> 7. Invoke `fut3=versionedDataNodes(zoneId=1, revision=8)`
> 8. Check that fut3 is completed exceptionally with 
> DistributionZoneNotFoundException.
> Check this test case for a zone with immediate and not immediate timers, 
> default and custom zones.
> *Test 10* validationTest
> Test steps:
> 1. Invoke `fut1=versionedDataNodes(zoneId=0, revision=0)`
> 2. Check that fut1 is completed exceptionally with IllegalArgumentException 
> (or AssertionError).
> 3. Invoke `fut1=versionedDataNodes(zoneId=0, revision=-1)`
> 4. Check that fut1 is completed exceptionally with Exception (or 
> AssertionError).
> *Test 11* simpleTopologyChanges
> Test steps:
> 1. Do topology changes:
> revision 1 - [nodeA],
> revision 5 - [nodeA, nodeB]
> 2. Create zone1 with zoneId=1 and immediate timers. Create event revision is 
> 7.
> 4. Get futures:
> Invoke `versionedDataNodes(zoneId=1, revision=7)`,
> Invoke `versionedDataNodes(zoneId=1, revision=10)`,
> Invoke `versionedDataNodes(zoneId=1, revision=15)`.
> 5. Check that futures are not completed.
> 3. Do topology changes:
> revision 10 - [nodeA, nodeB, nodeC],
> revision 15 - [nodeA, nodeC].
> 5. Check that futures are completed with corresponds values:
> revision 7 - [nodeA, nodeB],
> revision 10 - [nodeA, nodeB, nodeC],
> revision 15 - [nodeA, nodeC].



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to