Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Report: vtctldclient vdiff incorrectly limits rows #14777

Closed
mattlord opened this issue Dec 13, 2023 · 1 comment · Fixed by #14778
Closed

Bug Report: vtctldclient vdiff incorrectly limits rows #14777

mattlord opened this issue Dec 13, 2023 · 1 comment · Fixed by #14778

Comments

@mattlord
Copy link
Contributor

mattlord commented Dec 13, 2023

Overview of the Issue

The new vtctldclient vdiff implementation (added in v18) incorrectly limits the maximum rows diffed per table to the max-extra-rows-to-compare flag value (default: 1000).

Reproduction Steps

git checkout main && make build

cd examples/local

./101_initial_cluster.sh; mysql < ../common/insert_commerce_data.sql; ./201_customer_tablets.sh; ./202_move_tables.sh

for i in {1..10}; do mysql commerce -e "insert into customer (email) values ('${RANDOM}_person_${RANDOM}@planetscale.com'); insert into customer (email) select email from customer;"; done

sleep 60

vtctldclient vdiff --target-keyspace customer --workflow commerce2customer create

sleep 10

vtctldclient vdiff --target-keyspace customer --workflow commerce2customer show last

command mysql -u root --socket=${VTDATAROOT}/vt_0000000201/mysql.sock -e "select * from _vt.vdiff\G"

If you look at the vdiff output you'll see that it only processed 1005 rows and if you look at vdiff record on the target side, you'll see that the max_rows core option is set to 1,000:

mysql> select * from _vt.vdiff\G
*************************** 1. row ***************************
                id: 1
        vdiff_uuid: 95741c3f-b465-429d-b770-ad54a4ed0ddb
          workflow: commerce2customer
          keyspace: customer
             shard: 0
           db_name: vt_customer
             state: completed
           options: {"core_options": {"max_rows": 1000, "auto_retry": true, "timeout_seconds": 30, "max_extra_rows_to_compare": 1000}, "picker_options": {"source_cell": "zone1", "target_cell": "zone1", "tablet_types": "in_order:rdonly,replica,primary"}, "report_options": {"max_sample_rows": 10}}
        created_at: 2023-12-13 14:10:04
        started_at: 2023-12-13 19:10:04
liveness_timestamp: NULL
      completed_at: 2023-12-13 19:10:04
        last_error:

Binary Version

vtgate version Version: 19.0.0-SNAPSHOT (Git revision 5ee1b9b735f09c54a19177c1d6dd2b08e0fad136 branch 'main') built on Wed Dec 13 15:26:40 EST 2023 by matt@pslord.local using go1.21.5 darwin/arm64

Operating System and Environment details

N/A

Log Fragments

No response

@deepthi
Copy link
Member

deepthi commented Dec 13, 2023

Note: this affects v18 as well as main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants