Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

add s3 api to adapt cdc log (#456)#463

Merged
kennytm merged 5 commits intopingcap:release-4.0from
3pointer:pick-4.0
Aug 21, 2020
Merged

add s3 api to adapt cdc log (#456)#463
kennytm merged 5 commits intopingcap:release-4.0from
3pointer:pick-4.0

Conversation

@3pointer
Copy link
Collaborator

cherry-pick #456 to release-4.0

What problem does this PR solve?

part of pingcap/ticdc#826, to unify all s3 related api in the same repo. we decide to put new s3 api which ticdc needed into br.

What is changed and how it works?

move ticdc s3 api in br

Check List

Tests

  • Manual test (add detailed scripts or steps below)

Release Note

  • No release note

* add s3 api to adapt cdc log



Co-authored-by: kennytm <kennytm@gmail.com>
Copy link
Collaborator

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@HunDunDM
Copy link
Contributor

The function signature of ScanRegions is currently inconsistent between pd's release-4.0 and master. For details, please refer to: tikv/pd#2649

@kennytm
Copy link
Collaborator

kennytm commented Aug 21, 2020

thanks but i don't see how that is relevant to this PR (S3 API)

@HunDunDM
Copy link
Contributor

Before force pushing, ScanRegion appeared in the build error message.

// function; the second argument is the size in byte of the file determined
// by path.
func (l *LocalStorage) WalkDir(ctx context.Context, fn func(string, int64) error) error {
func (l *LocalStorage) WalkDir(ctx context.Context, dir string, listCount int64, fn func(string, int64) error) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the dir parameter means a specific sub dir to walk, the local implements should only walk the sub dir instead of ther whole base dir?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll fix it in next PR. because this is a cherry-pick PR

// function; the second argument is the size in byte of the file determined
// by path.
func (rs *S3Storage) WalkDir(ctx context.Context, fn func(string, int64) error) error {
func (rs *S3Storage) WalkDir(ctx context.Context, dir string, listCount int64, fn func(string, int64) error) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the listCount parameter (or maybe also the dir param) is only used for s3 implement as a contextal value, I think It's better to put this kind of control param into a abstract ctx interface{} field. Maybe there are other similar contextal paramers need for gcs for example?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll move these parameters in ctx after this PR merged, because this PR is a cherry-pick PR.

// UploadPart upload part of file data to storage
UploadPart(ctx context.Context, data []byte) error
// CompleteUpload make the upload data to a complete file
CompleteUpload(ctx context.Context) error
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, to name this as Close to be consistent with other io like interface is
a little better, anyway this is ok to me.

@3pointer
Copy link
Collaborator Author

/run-integration-tests

@kennytm kennytm removed the status/LGT1 LGTM1 label Aug 21, 2020
Copy link
Collaborator

@kennytm kennytm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kennytm kennytm added the status/LGT1 LGTM1 label Aug 21, 2020

// NeedAutoID checks whether the table needs backing up with an autoid.
func NeedAutoID(tblInfo *model.TableInfo) bool {
hasRowID := !tblInfo.PKIsHandle && !tblInfo.IsCommonHandle
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glorv
Copy link
Collaborator

glorv commented Aug 21, 2020

LGTM

@ti-srebot
Copy link
Contributor

@glorv,Thanks for your review. However, LGTM is restricted to Reviewers or higher roles.See the corresponding SIG page for more information. Related SIGs: tools(slack).

@glorv glorv added status/LGT2 LGTM2 and removed status/LGT1 LGTM1 labels Aug 21, 2020
@kennytm kennytm merged commit 97ac20a into pingcap:release-4.0 Aug 21, 2020
This was referenced Aug 21, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants