VSCopy: Send COPY_COMPLETED events when the copy operation is done#11740
VSCopy: Send COPY_COMPLETED events when the copy operation is done#11740mattlord merged 9 commits intovitessio:mainfrom
Conversation
…s new events showing copy completed Signed-off-by: yoheimuta <yoheimuta@gmail.com>
Signed-off-by: yoheimuta <yoheimuta@gmail.com>
Signed-off-by: yoheimuta <yoheimuta@gmail.com>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
If a new flag is being introduced:
If a workflow is added or modified:
Bug fixes
Non-trivial changes
New/Existing features
Backward compatibility
|
| `type:COPY_COMPLETED keyspace:"ks" shard:"80-"`, | ||
| `type:COPY_COMPLETED keyspace:"ks" shard:"-80"`, | ||
| `type:COPY_COMPLETED`, | ||
| } |
There was a problem hiding this comment.
With this PR change, the above three events are added to the expected events.
go/vt/vtgate/vstream_manager.go
Outdated
| case binlogdatapb.VEventType_COPY_COMPLETED: | ||
| sendevents = append(sendevents, event) | ||
| if fullyCopied := vs.generateFullyCopyCompleted(ctx, sgtid, event); fullyCopied != nil { | ||
| sendevents = append(sendevents, fullyCopied) |
There was a problem hiding this comment.
Only this addition is different from the case of, for example, OTHER.
In the case of COPY_COMPLETED, it's possible to generate and send an extra event.
| // This new event represents the completion of all the copy operations. | ||
| func (vs *vstream) generateFullyCopyCompleted(ctx context.Context, sgtid *binlogdatapb.ShardGtid, event *binlogdatapb.VEvent) *binlogdatapb.VEvent { | ||
| vs.mu.Lock() | ||
| defer vs.mu.Unlock() |
There was a problem hiding this comment.
The function generates an additional event while holding a lock for vs.vgtid.ShardGtids.
The same lock also protects the concurrent access to vs.copyCompletedShard.
| } | ||
| } | ||
| return &binlogdatapb.VEvent{ | ||
| Type: binlogdatapb.VEventType_COPY_COMPLETED, |
There was a problem hiding this comment.
This event has neither keyspace nor shard.
It represents the completion of data copy wherever the data is.
|
@mattlord @rohit-nayak-ps I made the changes I referred to at the slack thread. |
Thanks, @yoheimuta ! ❤️ These failures do seem legit, so can you look into those in the meantime? I will review this ASAP but no reason to wait on that front. We can discuss on Slack too if you need any help. |
…e vtadmin web protos Signed-off-by: Rohit Nayak <rohit@planetscale.com>
ade96a5 to
8912112
Compare
I fixed the failing We also need to run If there is not already a related issue for this, can you create one and link the PR to it (in Related Issues). Maybe you can just move the description of the problem statement that you have here into the issue ... To help discovery for open source users, we are trying to enforce that all PRs require an issue and the problem description and use case is in the issue and the resolution in the PR. Thx! |
I had a quick look at your changes and they look pretty good! |
|
Thank you for your advices and fixes!
It makes sense. |
…out out Signed-off-by: yoheimuta <yoheimuta@gmail.com>
|
I'm fixing the failure of |
… concurrently Signed-off-by: yoheimuta <yoheimuta@gmail.com>
| t.Logf("TestVStreamCopyBasic was successful") | ||
| return | ||
| } else if numExpectedEvents < len(evs) { | ||
| t.Fatalf("len(events)=%v are not expected\n", len(evs)) |
There was a problem hiding this comment.
Previously, once len(evs) gets greater than numExpectedEvents, End-to-End Test job failed due to the timeout while showing no specific errors. With this error message, it's hard to narrow down the cause.
ok vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/endtoend 0.130s
Error: The action has timed out.
- ref. https://github.com/vitessio/vitess/actions/runs/3477398228/jobs/5814821217
5825b27 makes the same test fail faster and shows more straightforward error messages.
--- FAIL: TestVStreamCopyBasic (0.02s)
vstream_test.go:244: len(events)=24 are not expected
...
FAIL vitess.io/vitess/go/vt/vtgate/endtoend 77.838s
| defer closeConnections() | ||
|
|
||
| _, err := conn.ExecuteFetch("insert into t1(id1,id2) values(1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8)", 1, false) | ||
| _, err := conn.ExecuteFetch("insert into t1_copy_basic(id1,id2) values(1,1), (2,2), (3,3), (4,4), (5,5), (6,6), (7,7), (8,8)", 1, false) |
There was a problem hiding this comment.
To pass the End-to-End Test, I prepared the exclusive table named t1_copy_basic. 9e4b5d8
The problem sharing t1 table with the other test cases (e.g. TestConsistentLookupMultiInsertIgnore) running concurrently is not introduced by this PR. Although the number of the received events matches by chance, content of the events vary depending on the concurrent tests in the first place.
(base) ❯ git branch | grep main
* main
# The events are expected.
(base) ❯ go test -v -count=1 -run "^TestVStreamCopyBasic$" vitess.io/vitess/go/vt/vtgate/endtoend --alsologtostderr
...
===START===
Event 0; type:BEGIN keyspace:"ks" shard:"-80"
Event 1; type:FIELD field_event:{table_name:"ks.t1" fields:{name:"id1" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_-80" org_name:"id1" column_length:20 charset:63 flags:53251} fields:{name:"id2" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_-80" org_name:"id2" column_length:20 charset:63 flags:32768} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 2; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}} shard_gtids:{keyspace:"ks" shard:"80-" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}}} keyspace:"ks" shard:"-80"
Event 3; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"55"}} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 4; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:1 values:"5"}}}} shard_gtids:{keyspace:"ks" shard:"80-" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}}} keyspace:"ks" shard:"-80"
Event 5; type:COMMIT keyspace:"ks" shard:"-80"
Event 6; type:BEGIN keyspace:"ks" shard:"80-"
Event 7; type:FIELD field_event:{table_name:"ks.t1" fields:{name:"id1" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_80-" org_name:"id1" column_length:20 charset:63 flags:53251} fields:{name:"id2" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_80-" org_name:"id2" column_length:20 charset:63 flags:32768} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 8; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:1 values:"5"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}}} keyspace:"ks" shard:"80-"
Event 9; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"66"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 10; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"77"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 11; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"88"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 12; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:1 values:"5"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:1 values:"8"}}}}} keyspace:"ks" shard:"80-"
Event 13; type:COMMIT keyspace:"ks" shard:"80-"
Event 14; type:BEGIN keyspace:"ks" shard:"80-"
Event 15; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:1 values:"5"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/82178ac0-6666-11ed-b225-e84ab9c3a7f8:1-75"}} keyspace:"ks" shard:"80-"
Event 16; type:COMMIT keyspace:"ks" shard:"80-"
===END===
vstream_test.go:222: TestVStreamCopyBasic was successful
--- PASS: TestVStreamCopyBasic (0.01s)
PASS
# Apparently, Event 6, Event 13, and Event 14 are not expected.
## I guess that these rows are inserted at https://github.com/vitessio/vitess/blob/4c33b2b5a90dc200e6cc649681cbace2520725bd/go/vt/vtgate/endtoend/lookup_test.go#L292.
$ go test -v -count=1 vitess.io/vitess/go/vt/vtgate/endtoend --alsologtostderr
...
===START===
Event 0; type:BEGIN keyspace:"ks" shard:"80-"
Event 1; type:FIELD field_event:{table_name:"ks.t1" fields:{name:"id1" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_80-" org_name:"id1" column_length:20 charset:63 flags:53251} fields:{name:"id2" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_80-" org_name:"id2" column_length:20 charset:63 flags:32768} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 2; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}}} keyspace:"ks" shard:"80-"
Event 3; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"66"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 4; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"77"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 5; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"88"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 6; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:2 lengths:2 values:"5060"}} keyspace:"ks" shard:"80-"} keyspace:"ks" shard:"80-"
Event 7; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:2 values:"50"}}}}} keyspace:"ks" shard:"80-"
Event 8; type:COMMIT keyspace:"ks" shard:"80-"
Event 9; type:BEGIN keyspace:"ks" shard:"-80"
Event 10; type:FIELD field_event:{table_name:"ks.t1" fields:{name:"id1" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_-80" org_name:"id1" column_length:20 charset:63 flags:53251} fields:{name:"id2" type:INT64 table:"t1" org_table:"t1" database:"vt_ks_-80" org_name:"id2" column_length:20 charset:63 flags:32768} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 11; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{fields:{name:"id1" type:INT32} rows:{lengths:1 values:"4"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:2 values:"50"}}}}} keyspace:"ks" shard:"-80"
Event 12; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:1 lengths:1 values:"55"}} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 13; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:2 lengths:2 values:"1020"}} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 14; type:ROW row_event:{table_name:"ks.t1" row_changes:{after:{lengths:2 lengths:2 values:"3040"}} keyspace:"ks" shard:"-80"} keyspace:"ks" shard:"-80"
Event 15; type:VGTID vgtid:{shard_gtids:{keyspace:"ks" shard:"-80" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:2 values:"30"}}}} shard_gtids:{keyspace:"ks" shard:"80-" gtid:"MySQL56/2ac38034-6667-11ed-a179-dd231a1931a8:1-148" table_p_ks:{table_name:"t1" lastpk:{rows:{lengths:2 values:"50"}}}}} keyspace:"ks" shard:"-80"
Event 16; type:COMMIT keyspace:"ks" shard:"-80"
===END===
vstream_test.go:222: TestVStreamCopyBasic was successful
--- PASS: TestVStreamCopyBasic (0.01s)
Since this discrepancy caused the test failure in my PR, I fixed it.
|
All checks have passed. Thank you! |
rohit-nayak-ps
left a comment
There was a problem hiding this comment.
Looks good!
Thanks for fixing the tests as well.
There was a problem hiding this comment.
Nice work on this! I had some minor questions/comments/suggestions. I'll let you make the final call on the subjective preferences noted. We can quickly address these and then get this merged! Feel free to respond here or reach out on slack, whichever you prefer. ❤️
|
A note about docs... I'm on the fence regarding whether or not this should be in the release notes. @rohit-nayak-ps, what do you think? I also think that we should probably add info here about these new events and what they signify: vitessio/website#1216 I'll link the two PRs. |
Signed-off-by: yoheimuta <yoheimuta@gmail.com>
Signed-off-by: yoheimuta <yoheimuta@gmail.com>
Signed-off-by: yoheimuta <yoheimuta@gmail.com>
|
@mattlord I applied all your suggestions and answered your question. I think it looks possible to pass the failed test by rerunning https://github.com/vitessio/vitess/actions/runs/3580407547/jobs/6022506484. |
Yes, it succeeded on a retry! |
mattlord
left a comment
There was a problem hiding this comment.
This is really good. Thanks again for fixing that long flaky test too! 🙂
Regarding the docs, I think we're good as:
- We have the existing release notes section which covers the new feature in general and links to the in progress new docs page: https://github.com/vitessio/vitess/blob/main/doc/releasenotes/16_0_0_summary.md#vstream-copy-resume
- We have that same open docs PR that we can add to for these new events: vitessio/website#1216
…itessio#11740) * VSCopy: Demonstrate to fail a test case on which the vstream API sends new events showing copy completed Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Send new events when the copy operation is done Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Fix typo Signed-off-by: yoheimuta <yoheimuta@gmail.com> * Initialize new map for the 'vstream * from' vtgate sql interface. Make vtadmin web protos Signed-off-by: Rohit Nayak <rohit@planetscale.com> * VSCopy: Make TestVStreamCopyBasic fail fast to avoid the end2end timeout out Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: stop sharing the 't1' table among multiple test cases running concurrently Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor the function signature to be clearer Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor the VEvents sorter to be simpler Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor to stop the sorter from including a fully copied event Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: Rohit Nayak <rohit@planetscale.com>
* add vtgate flag that explicitly allows vstream copy (#125) * fix fs.BoolVar Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * VSCopy: Resume the copy phase consistently from given GTID and lastpk (vitessio#11103) * VSCopy: Demonstrate to fail a test case on which the vstream API is supposed to resume the copy phase consistently Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Resume the copy phase consistently from given GTID and lastpk Signed-off-by: yoheimuta <yoheimuta@gmail.com> * Build out the unit test some more Signed-off-by: Matt Lord <mattalord@gmail.com> * Update tests for new behavior Signed-off-by: Matt Lord <mattalord@gmail.com> * Improve comments Signed-off-by: Matt Lord <mattalord@gmail.com> * Limit uvstreamer changes and update test Signed-off-by: Matt Lord <mattalord@gmail.com> * Revert uvstreamer test changes Signed-off-by: Matt Lord <mattalord@gmail.com> * Revert all uvstream changes Signed-off-by: Matt Lord <mattalord@gmail.com> * VCopy: Revert the last three commits Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VCopy: Add a new vstream type that allows picking up where we left off Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VCopy: Revert the unit test change Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VCopy: Fix the end-to-end CI test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * Update logic for setting up uvstreamer based on input vgtid/tablepks. Add more catchup events to test Signed-off-by: Rohit Nayak <rohit@planetscale.com> * Refactor logic to decide if event is to be sent. Enhance unit and e2e tests. Signed-off-by: Rohit Nayak <rohit@planetscale.com> * Don't send events for tables which we can identify as ones we haven't started copy for Signed-off-by: Rohit Nayak <rohit@planetscale.com> * Minor changes after self-review Signed-off-by: Rohit Nayak <rohit@planetscale.com> * Add vstream copy resume to release notes Signed-off-by: Matt Lord <mattalord@gmail.com> * Address review comments Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Co-authored-by: Rohit Nayak <rohit@planetscale.com> * VSCopy: Send COPY_COMPLETED events when the copy operation is done (vitessio#11740) * VSCopy: Demonstrate to fail a test case on which the vstream API sends new events showing copy completed Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Send new events when the copy operation is done Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Fix typo Signed-off-by: yoheimuta <yoheimuta@gmail.com> * Initialize new map for the 'vstream * from' vtgate sql interface. Make vtadmin web protos Signed-off-by: Rohit Nayak <rohit@planetscale.com> * VSCopy: Make TestVStreamCopyBasic fail fast to avoid the end2end timeout out Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: stop sharing the 't1' table among multiple test cases running concurrently Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor the function signature to be clearer Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor the VEvents sorter to be simpler Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: refactor to stop the sorter from including a fully copied event Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: Rohit Nayak <rohit@planetscale.com> * VSCopy: Enable to copy from all shards in either a specified keyspace or all keyspaces (vitessio#11909) * VSCopy: Demonstrate to fail a test case on which the vstream API request doesn't include keyspace and shard Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Copy from all shards in all keyspaces by specifying only an empty gtid Signed-off-by: yoheimuta <yoheimuta@gmail.com> * tests: Make TestRowCount stable regardless of the number of keyspaces Signed-off-by: yoheimuta <yoheimuta@gmail.com> * tests: Cleanup TestCreateAndDropDatabase correctly to stop TestVStreamCopyWithoutKeyspaceShard from failing when running tests together Signed-off-by: yoheimuta <yoheimuta@gmail.com> * tests: Tweak to fix a comment Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: fix the unit tests when the input vgtid with an empty gtid lacks either keyspace or shard Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Keyspace wildcard selection lines up with the table wildcard selection Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Tests the VCopy with multiple keyspaces and resharding Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Make TestVStreamCopyMultiKeyspaceReshard clearer to check if the streaming two keyspaces works even after reshard Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Return an invalid argument error if shards are unspecified and gtid is neither 'current' nor empty Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Add a test description about its purpose and target Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Remove duplicate literals in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Retain defaultReplicas variable in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Explain why we are setting Match to 'customer.*' in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Remove an unused VStreamFlag for the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Use sentence capitalization in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Verify that we didn't lose any events or get duplicates of the keyspace being reshareded in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Return a value instead of a pointer because there is no need to modify the value Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Add a comment describing what TestVStreamCopyFromAllKeyspacesAndAllShards is doing and why Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Add a comment describing why we expect these specific numbers of events from VStream API Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Tweak the test case name Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Make a utility function to sort COPY_COMPLETED events in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Replace the matcher with a simpler one in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Move the print debug call to the FailNow section in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Use require.NoError in new tests Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Use require instead of t.Fatalf in the test Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Apply the reviewer's suggestion to make the error message easier to read Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Add a comment noting what we're actually testing Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Correct the test comment and elaborate the special-case Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Tweak an error message and a comment Signed-off-by: yoheimuta <yoheimuta@gmail.com> * VSCopy: Adjust to a change in the signature of a test function that was introduced in the main repository Signed-off-by: yoheimuta <yoheimuta@gmail.com> --------- Signed-off-by: yoheimuta <yoheimuta@gmail.com> * attempt unit test fix Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> * update test error expected Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> --------- Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com> Signed-off-by: yoheimuta <yoheimuta@gmail.com> Signed-off-by: Matt Lord <mattalord@gmail.com> Signed-off-by: Rohit Nayak <rohit@planetscale.com> Co-authored-by: pbibra <pbibra@slack-corp.com> Co-authored-by: yohei yoshimuta <yoheimuta@gmail.com> Co-authored-by: Matt Lord <mattalord@gmail.com> Co-authored-by: Rohit Nayak <rohit@planetscale.com>
Description
The
COPY_COMPLETEDevent is sent every time either condition is met:In most cases (e.g., my use case), only the event without values is enough for error handling.
In some cases, the event corresponding to a single shard is helpful to handle it in a customized way.
Related Issue(s)
#11764
Checklist
Deployment Notes