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

owner: implement a basic owner, it can calculation resolvedTS #60

Merged
merged 11 commits into from
Oct 23, 2019
Merged

owner: implement a basic owner, it can calculation resolvedTS #60

merged 11 commits into from
Oct 23, 2019

Conversation

zier-one
Copy link
Contributor

@zier-one zier-one commented Oct 21, 2019

What problem does this PR solve?

implement a basic owner, it can calculation global resolvedTS

it can‘t calculation global checkpointTS now.
it can‘t handle the increase or remove of changfeed
it can‘t handle the increase or remove of subchangfeed
it can‘t handle the increase or remove of table

What is changed and how it works?

Check List

Tests

  • Unit test

@zier-one zier-one added the status/ptal Could you please take a look? label Oct 21, 2019
@zier-one zier-one changed the title owner: implement a base owner, it can calculation resolvedTS owner: implement a basic owner, it can calculation resolvedTS Oct 21, 2019
cdc/roles/owner.go Outdated Show resolved Hide resolved
cdc/roles/owner.go Outdated Show resolved Hide resolved
cdc/roles/owner.go Show resolved Hide resolved
@zier-one
Copy link
Contributor Author

@suzaku PTAL again

cdc/roles/owner.go Outdated Show resolved Hide resolved
cdc/roles/owner.go Outdated Show resolved Hide resolved
cdc/roles/owner.go Outdated Show resolved Hide resolved
cdc/roles/owner_test.go Outdated Show resolved Hide resolved
cdc/roles/owner.go Outdated Show resolved Hide resolved
// ChangeFeedInfoRWriter defines the Reader and Writer for ChangeFeedInfo
type ChangeFeedInfoRWriter interface {
// Read the changefeed info from storage such as etcd.
Read(ctx context.Context) (map[ChangeFeedID]ProcessorsInfos, error)
Copy link
Contributor

Choose a reason for hiding this comment

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

How are you planning to implement Read?

Copy link
Contributor Author

@zier-one zier-one Oct 22, 2019

Choose a reason for hiding this comment

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

I think we can read all of change feed info

zap.Reflect("ddlJob", todoDDLJob))
return
}
if cfInfo.status != ChangeFeedExecDDL {
Copy link
Contributor

Choose a reason for hiding this comment

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

When would this be set to something unexpected? It seems that it's just set before the goroutine starts.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just to be sure, If cfInfo.status is changed for some reason(such as concurrency problem), the correctness of data will be broke, we need a obviously error.

Copy link
Contributor

@amyangfei amyangfei left a comment

Choose a reason for hiding this comment

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

LGTM

@amyangfei amyangfei added LGT1 and removed status/ptal Could you please take a look? labels Oct 22, 2019
Copy link
Contributor

@suzaku suzaku left a comment

Choose a reason for hiding this comment

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

LGTM

@suzaku suzaku added LGT2 and removed LGT1 labels Oct 23, 2019
@zier-one zier-one merged commit 634314b into pingcap:master Oct 23, 2019
@zier-one zier-one deleted the owner2 branch October 23, 2019 02:47
5kbpers pushed a commit to 5kbpers/ticdc that referenced this pull request Aug 24, 2020
amyangfei pushed a commit to amyangfei/tiflow that referenced this pull request May 6, 2022
part job of pingcap#60
This PR supports the suspending of jobs and tasks, but it hasn't considered the consistency after fail-over.

The "suspend" is implemented in an async way, because suspending might happen when rescheduling or fail recovering.
After the user sends suspend request, we mark the "target status" for the target tasks. A goroutine will check the status regularly, and will try to suspend it util success. There are some work to do furture.

* The commands should be serializable. If several commands are sent in the same time, we should order them.
* The command have to be persisted and to be continued when node crashes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants