-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
Feature: Initialize router metadata from Etcd | ||
Background: | ||
# | ||
# Run routers with coordinators | ||
# Stop all coordinators | ||
# | ||
Given cluster environment is | ||
""" | ||
ROUTER_CONFIG=/spqr/test/feature/conf/router_with_coordinator.yaml | ||
COORDINATOR_CONFIG=/spqr/test/feature/conf/router_coordinator.yaml | ||
COORDINATOR_CONFIG_2=/spqr/test/feature/conf/router_coordinator_2.yaml | ||
""" | ||
Given cluster is up and running | ||
And host "coordinator2" is stopped | ||
When I run SQL on host "router-admin" | ||
""" | ||
UNREGISTER ROUTER ALL; | ||
REGISTER ROUTER r1 ADDRESS regress_router::7000; | ||
REGISTER ROUTER r2 ADDRESS regress_router_2::7000; | ||
""" | ||
Then command return code should be "0" | ||
And host "router" is stopped | ||
And host "router2" is stopped | ||
|
||
Scenario: Router initialize its metadata from Etcd when no coodinator alive | ||
When I run SQL on host "router-admin" | ||
""" | ||
CREATE DISTRIBUTION ds1 COLUMN TYPES integer; | ||
CREATE KEY RANGE krid1 FROM 19 ROUTE TO sh1 FOR DISTRIBUTION ds1; | ||
""" | ||
Then command return code should be "0" | ||
|
||
When host "coordinator" is stopped | ||
And host "router" is started | ||
|
||
When I run SQL on host "router-admin" | ||
""" | ||
SHOW key_ranges | ||
""" | ||
Then SQL result should match json_exactly | ||
""" | ||
[{ | ||
"Key range ID":"krid1", | ||
"Distribution ID":"ds1", | ||
"Lower bound":"19", | ||
"Shard ID":"sh1" | ||
}] | ||
""" |