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

redolog : redolog storage layer data model & common util #2809

Merged
merged 10 commits into from
Sep 30, 2021

Conversation

ben1009
Copy link
Contributor

@ben1009 ben1009 commented Sep 14, 2021

What problem does this PR solve?

#2351 redo log based replication to implement eventually consistency
#2685 contains all of the change for the requirement, will split into small ones for review, this is one of the prs, split from the #2685

What is changed and how it works?

this one contains basic data model, common util used in the fellowing PRs

Check List

Tests

  • Unit test

Code changes

  • Has exported function/method change
  • Has exported variable/fields change

Side effects

Related changes

Release note

None

@ti-chi-bot
Copy link
Member

ti-chi-bot commented Sep 14, 2021

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • amyangfei
  • hi-rustin

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@ti-chi-bot ti-chi-bot added the release-note-none Denotes a PR that doesn't merit a release note. label Sep 14, 2021
@ti-chi-bot ti-chi-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Sep 14, 2021
@amyangfei amyangfei added this to the v5.3.0 milestone Sep 14, 2021
cdc/model/sink.go Outdated Show resolved Hide resolved
cdc/model/sink.go Show resolved Hide resolved
cdc/redo/common/redo.go Outdated Show resolved Hide resolved
@amyangfei amyangfei added the status/ptal Could you please take a look? label Sep 18, 2021
cdc/model/sink.go Outdated Show resolved Hide resolved
cdc/model/sink.go Show resolved Hide resolved
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

Go through it!

cdc/model/sink.go Show resolved Hide resolved
cdc/model/sink.go Outdated Show resolved Hide resolved
cdc/redo/common/redo.go Outdated Show resolved Hide resolved
cdc/redo/common/redo.go Outdated Show resolved Hide resolved
cdc/redo/common/redo.go Show resolved Hide resolved
cdc/redo/common/redo.go Outdated Show resolved Hide resolved
// InitS3storage init a storage used for s3,
// s3URI should be like s3URI="s3://logbucket/test-changefeed?endpoint=http://$S3_ENDPOINT/"
func InitS3storage(ctx context.Context, s3URI url.URL) (storage.ExternalStorage, error) {
if len(s3URI.Host) == 0 {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to check its protocol?

cdc/redo/common/util_test.go Outdated Show resolved Hide resolved
cdc/redo/common/util.go Show resolved Hide resolved
Copy link
Member

@Rustin170506 Rustin170506 left a comment

Choose a reason for hiding this comment

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

There are still some minor issues, but it looks good. I would suggest aligning the msg annotation name with the json.

rest LGTM. 👍

// fmt.Sprintf("%s_%s_%d_%s_%d%s", w.cfg.captureID, w.cfg.changeFeedID, w.cfg.createTime.Unix(), w.cfg.fileType, w.commitTS.Load(), LogEXT)+SortLogEXT
if ext == SortLogEXT {
name = strings.TrimSuffix(name, SortLogEXT)
ext = filepath.Ext(name)
Copy link
Member

Choose a reason for hiding this comment

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

This should be the ext of the log file, maybe we could call it logExt for clarity?

}

// if .sort, the name should be like
// fmt.Sprintf("%s_%s_%d_%s_%d%s", w.cfg.captureID, w.cfg.changeFeedID, w.cfg.createTime.Unix(), w.cfg.fileType, w.commitTS.Load(), LogEXT)+SortLogEXT
Copy link
Member

Choose a reason for hiding this comment

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

It would be nice to add a real example!

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 29, 2021
cdc/model/sink.go Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 30, 2021
@ti-chi-bot ti-chi-bot added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 30, 2021
@amyangfei
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: fa8fcd7

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 30, 2021
@amyangfei
Copy link
Contributor

/run-kafka-tests

@amyangfei
Copy link
Contributor

/run-all-tests

@ti-chi-bot
Copy link
Member

@ben1009: Your PR was out of date, I have automatically updated it for you.

At the same time I will also trigger all tests for you:

/run-all-tests

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ben1009
Copy link
Contributor Author

ben1009 commented Sep 30, 2021

/run-kafka-tests
/run-integration-tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/redolog release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. status/ptal Could you please take a look?
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants