-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
ddl, stat: switch to new struct for remove partition, flash back and remove DDLEvent
#55973
ddl, stat: switch to new struct for remove partition, flash back and remove DDLEvent
#55973
Conversation
Hi @fzzf678. 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #55973 +/- ##
=================================================
- Coverage 72.8567% 57.2276% -15.6292%
=================================================
Files 1605 1755 +150
Lines 446200 634824 +188624
=================================================
+ Hits 325087 363295 +38208
- Misses 101079 246800 +145721
- Partials 20034 24729 +4695
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
rest lgtm
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.
Thansk!
pkg/ddl/util/util_test.go
Outdated
result := e.String() | ||
|
||
// Check the result | ||
expected := "(Event Type: add column, Table ID: 1, Table Name: Table1, Old Table ID: 4, Old Table Name: Table2, Partition Name: , Partition ID: 2, Partition Name: , Partition ID: 3, Dropped Partition Name: , Dropped Partition ID: 5, Dropped Partition Name: , Dropped Partition ID: 6, Column ID: 7, Column Name: Column1, Column ID: 8, Column Name: Column2)" |
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.
Do we need to print an empty string if the name is empty?
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, only print non-empty name, PTAL again
if isSysDB, err := t.IsMemOrSysDB(sctx.(sessionctx.Context)); err != nil { | ||
return err | ||
} else if isSysDB { | ||
// EXCHANGE PARTITION EVENT NOTES: |
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.
Better to keep this comment somewhere. We allow users to exchange one normal table for a system table.
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.
rest LGTM
/hold
Feel free to unhold after you address them.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lance6716, Rustin170506 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 |
[LGTM Timeline notifier]Timeline:
|
Co-authored-by: Rustin <[email protected]>
Co-authored-by: Rustin <[email protected]>
pkg/statistics/handle/ddl/ddl.go
Outdated
case model.ActionFlashbackCluster: | ||
return h.statsWriter.UpdateStatsVersion() | ||
default: | ||
return errors.Trace(errors.Errorf("unhandled DDL type %v", s.GetType())) |
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 think just an error log would be enough.
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 intest
to remind PR author when adding new event types.
/unhold |
/hold |
pkg/statistics/handle/ddl/ddl.go
Outdated
@@ -183,7 +186,8 @@ func (h *ddlHandlerImpl) HandleDDLEvent(s *ddlutil.SchemaChangeEvent) error { | |||
case model.ActionFlashbackCluster: | |||
return h.statsWriter.UpdateStatsVersion() | |||
default: | |||
return errors.Trace(errors.Errorf("unhandled DDL type %v", s.GetType())) | |||
intest.Assert(false) | |||
logutil.StatsLogger().Error("Unhandled schema change event", zap.Stringer("type", s.GetType())) |
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.
Do we need to print the whole event 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.
What’s the purpose of printing the whole event in log?
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 just thought that the purpose of this default branch is to remind developer there is an unhandled event, any other use? 🤔
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 guess it would be easier to figure out what information is in it. But I am okay with it if you only want to print the type 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.
PTAL again 8b171a4
/unhold Thank you very much. |
…remove `DDLEvent` (pingcap#55973) ref pingcap#55723
…remove `DDLEvent` (pingcap#55973) ref pingcap#55723
What problem does this PR solve?
Issue Number: ref #55723
Problem Summary:
What changed and how does it work?
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.