Skip to content

Instantly share code, notes, and snippets.

@grahamc
Last active February 4, 2017 01:36
Show Gist options
  • Save grahamc/4121df8ca9f692c6f5dedf8aaab89612 to your computer and use it in GitHub Desktop.
Save grahamc/4121df8ca9f692c6f5dedf8aaab89612 to your computer and use it in GitHub Desktop.
builtins.listToAttrs [
(verify-test-case "simple-shard-cutover" {
starting-spare-dbs = 5;
test-phases = [
(phase "setupwhatever" "/etc/setupwhat.sh")
(phase "shard-cutover" ''
jetpants shard-cutover --cutover-id=10000 --shard-pool=posts
'')
(assert-shard-exists "POSTS-1-9999")
(assert-shard-exists "POSTS-10000-INFINITY")
(assert-master-has-n-slaves "POSTS-10000-INFINITY" 4)
];
})
(verify-test-case "simple-shard-split" {
starting-spare-dbs = 10;
test-phases = [
(assert-shard-exists "POSTS-1-INFINITY")
(phase "shard-split" ''
jetpants shard-split --min-id=1 --max-id=INFINITY \
--count=2 --shard-pool=posts
'')
(assert-shard-does-not-exist "POSTS-1-INFINITY")
(assert-shard-exists "POSTS-1-4999")
(assert-shard-exists "POSTS-5000-INFINITY")
(assert-master-has-n-slaves "POSTS-1-4999" 4)
(assert-master-has-n-slaves "POSTS-5000-INFINITY" 4)
];
})
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment