-
Notifications
You must be signed in to change notification settings - Fork 51
100w-master #4958
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
base: master
Are you sure you want to change the base?
100w-master #4958
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 | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -47,7 +47,7 @@ import ( | |||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| const ( | ||||||||||||||||||||||||||||||||
| periodEventInterval = time.Millisecond * 100 | ||||||||||||||||||||||||||||||||
| periodEventInterval = time.Second * 120 | ||||||||||||||||||||||||||||||||
| periodRedoInterval = time.Second * 1 | ||||||||||||||||||||||||||||||||
|
Comment on lines
+50
to
51
Contributor
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. 120s shared periodic tick can regress checkpoint freshness and resend recovery.
Suggested split of intervals const (
- periodEventInterval = time.Second * 120
+ periodEventInterval = time.Second * 120 // resend/housekeeping
+ checkpointCalcInterval = time.Second // checkpoint advancement cadence
periodRedoInterval = time.Second * 1
)
@@
-func (m *Maintainer) calCheckpointTs(ctx context.Context) {
- ticker := time.NewTicker(periodEventInterval)
+func (m *Maintainer) calCheckpointTs(ctx context.Context) {
+ ticker := time.NewTicker(checkpointCalcInterval)🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
|
|
@@ -309,7 +309,7 @@ func (m *Maintainer) HandleEvent(event *Event) bool { | |||||||||||||||||||||||||||||||
| zap.Stringer("changefeedID", m.changefeedID), | ||||||||||||||||||||||||||||||||
| zap.Int("eventType", event.eventType), | ||||||||||||||||||||||||||||||||
| zap.Duration("duration", duration), | ||||||||||||||||||||||||||||||||
| zap.Any("Message", event.message), | ||||||||||||||||||||||||||||||||
| zap.Any("MessageType", event.message.Type), | ||||||||||||||||||||||||||||||||
|
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. Using
Suggested change
Contributor
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. Guard
Nil-safe logging tweak if event.eventType == EventMessage {
+ messageType := "nil"
+ if event.message != nil {
+ messageType = event.message.Type.String()
+ }
log.Info("maintainer is too slow",
zap.Stringer("changefeedID", m.changefeedID),
zap.Int("eventType", event.eventType),
zap.Duration("duration", duration),
- zap.Any("MessageType", event.message.Type),
+ zap.String("messageType", messageType),
)
} else {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||
| log.Info("maintainer is too slow", | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
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.
Increasing
periodEventIntervalfrom 100ms to 120s is a drastic change that will significantly impact the system's responsiveness. This interval controls how frequently the maintainer calculates the global checkpoint and resends critical messages (such as bootstrap requests or barrier ACKs). A 2-minute delay in these operations will lead to excessive replication lag and extremely slow recovery from transient network issues or node failures. If this change was intended to reduce CPU overhead for large-scale changefeeds (e.g., 1 million tables), it should be made configurable or set to a more reasonable value like 1-5 seconds.