-
Notifications
You must be signed in to change notification settings - Fork 31
consumer: ignore fallback dml event #3864
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -434,6 +434,13 @@ func (w *writer) appendRow2Group(dml *commonEvent.DMLEvent, progress *partitionP | |||||||||||||||||
| group = util.NewEventsGroup(progress.partition, tableID) | ||||||||||||||||||
| progress.eventsGroup[tableID] = group | ||||||||||||||||||
| } | ||||||||||||||||||
| if commitTs < progress.watermark { | ||||||||||||||||||
| log.Warn("DML Event fallback row, since less than the partition watermark, ignore it", | ||||||||||||||||||
| zap.Int64("tableID", tableID), zap.Int32("partition", group.Partition), | ||||||||||||||||||
| zap.Uint64("commitTs", commitTs), zap.Uint64("watermark", progress.watermark), | ||||||||||||||||||
| zap.String("schema", schema), zap.String("table", table)) | ||||||||||||||||||
|
Comment on lines
+438
to
+441
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The log message is a bit verbose. The reason for ignoring the event ("since less than the partition watermark") is already evident from the logged
Suggested change
|
||||||||||||||||||
| return | ||||||||||||||||||
| } | ||||||||||||||||||
| if commitTs >= group.HighWatermark { | ||||||||||||||||||
| group.Append(dml, false) | ||||||||||||||||||
| log.Info("DML event append to the group", | ||||||||||||||||||
|
|
||||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,11 +117,11 @@ func parseBit(s string, n int) string { | |
| } | ||
|
|
||
| func getValueFromDefault(defaultVal any, tp *types.FieldType) any { | ||
| // defaultValue shoul be string | ||
| // defaultValue should be string | ||
| // see https://github.com/pingcap/tidb/blob/72b1b7c564c301de33a4bd335a05770c78528db4/pkg/ddl/add_column.go#L791 | ||
| val, ok := defaultVal.(string) | ||
| if !ok { | ||
| log.Debug("default value is not string", zap.Any("defaultValue", defaultVal)) | ||
| log.Warn("default value is not string", zap.Any("defaultValue", defaultVal)) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If this is only used in the testing code, set it to panic. |
||
| return defaultVal | ||
| } | ||
| // TODO: more data types need be consider | ||
|
|
||
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.
The log message is a bit verbose. The reason for ignoring the event ("since less than the partition watermark") is already evident from the logged
commitTsandwatermarkfields. A more concise message would improve log readability and maintainability.