-
Notifications
You must be signed in to change notification settings - Fork 282
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: add lock control in owner table info writer #154
Conversation
pls resolve conflict |
if writePLock { | ||
newInfo.TablePLock = &model.TableLock{ | ||
Ts: oracle.EncodeTSO(time.Now().UnixNano() / int64(time.Millisecond)), | ||
CreatorID: util.CaptureIDFromCtx(ctx), |
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.
I will prefer explicitly param here, but ok with this too now.
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
cdc/owner.go
Outdated
subInfo.RemoveTable(id) | ||
|
||
newInfo, err := c.infoWriter.Write(ctx, c.ID, captureID, subInfo, true) | ||
c.ProcessorInfos[captureID] = newInfo |
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.
Only set it when err != nil
? If newInfo
is nil
on error, later calls to restoreTableInfos
may end in runtime error.
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.
fixed, PTAL
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
What problem does this PR solve?
When owner add or remove a table to subchangefeedinfo in etcd, it should concern the
table-p-lock
.Owner also needs to guarantee local
SubChangeFeedInfo
is up to date before writing new data into etcd.What is changed and how it works?
table-p-lock
is not resolved, wait for it resolved.table-p-lock
is resolved, remove bothtable-p-lock
andtable-c-lock
from etcd.Check List
Tests