-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
*: add tiflash replica sync progress #14713
Conversation
Signed-off-by: crazycs <crazycs520@gmail.com>
Signed-off-by: crazycs <crazycs520@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Signed-off-by: crazycs <crazycs520@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
server/http_handler.go
Outdated
if available { | ||
err = infosync.DeleteTiFlashTableSyncProgress(status.ID) | ||
} else { | ||
err = infosync.UpdateTiFlashTableSyncProgress(context.Background(), status.ID, float64(status.RegionCount)/float64(status.FlashRegionCount)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are RegionCount
and FlashRegionCount
? These names are confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, already add a comment for those fields.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest is quite ok.
Signed-off-by: crazycs <crazycs520@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest LGTM
Co-Authored-By: Arenatlx <ailinsilence4@gmail.com>
Co-Authored-By: Arenatlx <ailinsilence4@gmail.com>
/run-all-tests |
/run-unit-test |
1 similar comment
/run-unit-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
/rebuild |
Signed-off-by: crazycs <crazycs520@gmail.com>
Signed-off-by: crazycs crazycs520@gmail.com
What problem does this PR solve?
Add tiflash replica sync
Progress
intiflash_replica
table.What is changed and how it works?
Store the sync progress info in PD(etcd) when TiFlash report the progress.
When sync progress finished, delete the progress info in PD.
Check List
Tests
Step 1: mock tiflash report sync info.
Step 2: check the progress info in the PD(etcd)
▶ etcdctl --endpoints=127.0.0.1:2379 get "/tiflash" --prefix /tiflash/table/sync/129 0.67 /tiflash/table/sync/140 0.83
step 3: query progress info from
tiflash_replica
Step 4: mock tiflash report sync info. mock for table_id=140 already sync finished.
▶ curl -X POST -d '{"id":140,"region_count":6,"flash_region_count":6}' http://127.0.0.1:10080/tiflash/replica
Step 5: check the progress info in the PD(etcd)
step 6: query progress info from
tiflash_replica
Code changes
Side effects
Related changes
Release note
TIFLAH_REPLICA
table.