-
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
lightning: fix id too large after parallel import #57398
Conversation
Hi @D3Hunter. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
// if another instance finished import before below checksum logic, | ||
// it will cause checksum mismatch, but it's very rare. |
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.
see #57399
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #57398 +/- ##
================================================
+ Coverage 72.9011% 74.0038% +1.1026%
================================================
Files 1668 1702 +34
Lines 461134 480713 +19579
================================================
+ Hits 336172 355746 +19574
+ Misses 104308 103452 -856
- Partials 20654 21515 +861
Flags with carried forward coverage won't be shown. Click here to find out more.
|
@lance6716 ping |
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.
(will review soon)
Makefile
Outdated
@@ -530,7 +530,7 @@ br_bins: | |||
|
|||
.PHONY: data_parsers | |||
data_parsers: tools/bin/vfsgendev pkg/lightning/mydump/parser_generated.go lightning_web | |||
PATH="$(GOPATH)/bin":"$(PATH)":"$(TOOLS)" protoc -I. -I"$(GOPATH)/src" pkg/lightning/checkpoints/checkpointspb/file_checkpoints.proto --gogofaster_out=. | |||
PATH="$(GOPATH)/bin":"$(PATH)":"$(TOOLS)" protoc -I. -I"$(GOPATH)/pkg/mod" pkg/lightning/checkpoints/checkpointspb/file_checkpoints.proto --gogofaster_out=. |
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.
maybe use GOMODCACHE
value from go env
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.
15 / 32 files viewed
@@ -188,22 +188,31 @@ func (m *dbTableMetaMgr) AllocTableRowIDs(ctx context.Context, rawRowIDMax int64 | |||
DB: conn, | |||
Logger: m.tr.logger, | |||
} | |||
var newRowIDBase, newRowIDMax int64 | |||
curStatus := metaStatusInitial | |||
// (myStartRowID, myEndRowID] is the range of row_id that current instance |
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.
can we use [start, end)? This is a bit strange and we have to -1
in GetMaxAutoIDBAse
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.
that's how auto id allocator works now, both in TiDB and lightning, won't do it here
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.
27 / 32 files viewed
@@ -1990,20 +1990,12 @@ type deliverResult struct { | |||
} | |||
|
|||
func saveCheckpoint(rc *Controller, t *TableImporter, engineID int32, chunk *checkpoints.ChunkCheckpoint) { | |||
// We need to update the AllocBase every time we've finished a file. |
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.
this line of comment can be kept. Maybe it reminds us to keep the consistency of "ID used for encoding data" and "ID saved in checkpoint"
@lance6716: Your lgtm message is repeated, so it is ignored. In response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
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
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: GMHDBJD, lance6716 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@D3Hunter: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/retest |
@D3Hunter: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
In response to a cherrypick label: new pull request created to branch |
In response to a cherrypick label: new pull request created to branch |
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
What problem does this PR solve?
Issue Number: close #56814
Problem Summary:
What changed and how does it work?
previously with parallel import, the auto id after import is the estimated ones even though there are IDs inside the data source file, we change to the ones inside the data source file to avoid next auto id too large
to do this, we need to save different values for different auto id in checkpoint
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.