Skip to content

Instantly share code, notes, and snippets.

@dasl-
Created May 27, 2021 21:30
Show Gist options
  • Save dasl-/4e8e5a91fcf7d2b1daf0ee553655ba64 to your computer and use it in GitHub Desktop.
Save dasl-/4e8e5a91fcf7d2b1daf0ee553655ba64 to your computer and use it in GitHub Desktop.
vtctl MoveTables -cells=etsy_cells -workflow=ks2to3_workflow ks2 ks3 'ks2to3_test'
vtctl SwitchReads -tablet_type=rdonly ks3.ks2to3_workflow
vtctl SwitchReads -tablet_type=replica ks3.ks2to3_workflow
vtctl SwitchWrites ks3.ks2to3_workflow
vtctl SwitchReads -tablet_type=rdonly ks2.ks2to3_workflow_reverse
vtctl SwitchReads -tablet_type=replica ks2.ks2to3_workflow_reverse
vtctl_etsy SwitchWrites ks2.ks2to3_workflow_reverse
# after executing the previous command, i *think* that `select * from _vt.vreplication\G` might show non-fully qualified vindex names in the in_keyrange clause...
CREATE TABLE `ks1_test` (
`k` bigint(20) NOT NULL,
`v` bigint(20) NOT NULL,
PRIMARY KEY (`k`, `v`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
}
},
"tables": {
"ks1_test": { "column_vindexes": [ { "name": "hash", "column": "k" } ] }
}
}
CREATE TABLE `ks2to3_test` (
`k` bigint(20) NOT NULL,
`v` bigint(20) NOT NULL,
PRIMARY KEY (`k`, `v`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
CREATE TABLE `ks2to3_test` (
`k` bigint(20) NOT NULL,
`v` bigint(20) NOT NULL,
PRIMARY KEY (`k`, `v`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
{
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
}
},
"tables": {
"ks2to3_test": { "column_vindexes": [ { "name": "hash", "column": "k" } ] }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment