Adding a db merge end to end test.#1635
Conversation
And fix all the bugs it un-covers.
|
LGTM But I'm not happy with the degree of duplication in the test. I think it's time for a utils_resharding.py module or something similar. Reviewed 6 of 6 files at r1. test/merge_sharding.py, line 47 [r1] (raw file): test/merge_sharding.py, line 57 [r1] (raw file): test/merge_sharding.py, line 164 [r1] (raw file): test/merge_sharding.py, line 179 [r1] (raw file): test/merge_sharding.py, line 211 [r1] (raw file): self._insert_value(shard_0_master, 'resharding1', 0, 'msg1', ? Or: self._insert_value(shard_1_master, 'resharding1', 1, 'msg1', test/merge_sharding.py, line 235 [r1] (raw file): test/merge_sharding.py, line 236 [r1] (raw file): self._insert_value(shard_1_master, 'resharding1', 1, 'msg1', test/merge_sharding.py, line 263 [r1] (raw file): test/merge_sharding.py, line 273 [r1] (raw file): Can you please deduplicate it? I would like to avoid duplicate resharding test code as much as possible. test/merge_sharding.py, line 304 [r1] (raw file): You'll probably still want the explicit healthcheck here to not wait for the next periodic one. Comments from Reviewable |
|
Review status: all files reviewed at latest revision, 10 unresolved discussions. test/merge_sharding.py, line 47 [r1] (raw file): test/merge_sharding.py, line 57 [r1] (raw file): test/merge_sharding.py, line 164 [r1] (raw file): test/merge_sharding.py, line 179 [r1] (raw file):
test/merge_sharding.py, line 211 [r1] (raw file): test/merge_sharding.py, line 235 [r1] (raw file): test/merge_sharding.py, line 236 [r1] (raw file): test/merge_sharding.py, line 263 [r1] (raw file): test/merge_sharding.py, line 273 [r1] (raw file): test/merge_sharding.py, line 304 [r1] (raw file): Comments from Reviewable |
Creating a new base class for sharding tests. Using it in initial_sharding, merge_sharding, resharding and vertical_split. Adding consistent checks in all of these. Refactoring them to all match (all_tablets list at beginning, ...). Also fixing a reporting bug in binlog server, the wrong var was used for update stream. Actually found this with the tests!
|
@michael-berlin PTAL I factored out a bunch of stuff. We can still do better. |
In the process, re-factoring utils.wait_for_vars so it can also take a key and value, and therefore can be used by a VtGate.wait_for_endpoints() method. Using that method in a few tests instead of custom cut&paste code.
|
Reviewed 2 of 2 files at r2, 6 of 6 files at r3, 5 of 5 files at r4, 5 of 5 files at r5, 5 of 5 files at r6. test/resharding.py, line 21 [r3] (raw file): I suggest to add "vtctl" to be explicit about it:
test/utils.py, line 382 [r6] (raw file): ? test/utils.py, line 383 [r6] (raw file): ? Comments from Reviewable |
And fix all the bugs it un-covers.
@enisoc @michael-berlin
This change is