-
Notifications
You must be signed in to change notification settings - Fork 298
dm: draft PR for aeon temp builds #12413
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: release-8.5
Are you sure you want to change the base?
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 | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -102,7 +102,8 @@ var ( | |||||||
| defaultWorkerCount = 16 | ||||||||
| defaultBatch = 100 | ||||||||
| defaultQueueSize = 1024 // do not give too large default value to avoid OOM | ||||||||
| defaultCheckpointFlushInterval = 30 // in seconds | ||||||||
| defaultEventCacheCount = 10240 | ||||||||
| defaultCheckpointFlushInterval = 30 // in seconds | ||||||||
| defaultSafeModeDuration = strconv.Itoa(2*defaultCheckpointFlushInterval) + "s" | ||||||||
|
|
||||||||
| // TargetDBConfig. | ||||||||
|
|
@@ -390,10 +391,11 @@ func (m *LoaderConfig) adjust() error { | |||||||
|
|
||||||||
| // SyncerConfig represents syncer process unit's specific config. | ||||||||
| type SyncerConfig struct { | ||||||||
| MetaFile string `yaml:"meta-file" toml:"meta-file" json:"meta-file"` // meta filename, used only when load SubConfig directly | ||||||||
| WorkerCount int `yaml:"worker-count" toml:"worker-count" json:"worker-count"` | ||||||||
| Batch int `yaml:"batch" toml:"batch" json:"batch"` | ||||||||
| QueueSize int `yaml:"queue-size" toml:"queue-size" json:"queue-size"` | ||||||||
| MetaFile string `yaml:"meta-file" toml:"meta-file" json:"meta-file"` // meta filename, used only when load SubConfig directly | ||||||||
| WorkerCount int `yaml:"worker-count" toml:"worker-count" json:"worker-count"` | ||||||||
| Batch int `yaml:"batch" toml:"batch" json:"batch"` | ||||||||
| QueueSize int `yaml:"queue-size" toml:"queue-size" json:"queue-size"` | ||||||||
| EventCacheCount int `yaml:"event-cache-count" toml:"event-cache-count" json:"event-cache-count"` | ||||||||
|
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. For better maintainability and user-friendliness, please add a comment explaining what
Suggested change
|
||||||||
| // checkpoint flush interval in seconds. | ||||||||
| CheckpointFlushInterval int `yaml:"checkpoint-flush-interval" toml:"checkpoint-flush-interval" json:"checkpoint-flush-interval"` | ||||||||
| // TODO: add this two new config items for openapi. | ||||||||
|
|
@@ -420,6 +422,7 @@ func DefaultSyncerConfig() SyncerConfig { | |||||||
| WorkerCount: defaultWorkerCount, | ||||||||
| Batch: defaultBatch, | ||||||||
| QueueSize: defaultQueueSize, | ||||||||
| EventCacheCount: defaultEventCacheCount, | ||||||||
| CheckpointFlushInterval: defaultCheckpointFlushInterval, | ||||||||
| SafeModeDuration: defaultSafeModeDuration, | ||||||||
| } | ||||||||
|
|
@@ -448,6 +451,7 @@ type ValidatorConfig struct { | |||||||
| BatchQuerySize int `yaml:"batch-query-size" toml:"batch-query-size" json:"batch-query-size"` | ||||||||
| MaxPendingRowSize string `yaml:"max-pending-row-size" toml:"max-pending-row-size" json:"max-pending-row-size"` | ||||||||
| MaxPendingRowCount int `yaml:"max-pending-row-count" toml:"max-pending-row-count" json:"max-pending-row-count"` | ||||||||
| EventCacheCount int `yaml:"event-cache-count" toml:"event-cache-count" json:"event-cache-count"` | ||||||||
|
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. To improve configuration clarity for users, please add a comment for
Suggested change
|
||||||||
| StartTime string `yaml:"-" toml:"start-time" json:"-"` | ||||||||
| } | ||||||||
|
|
||||||||
|
|
@@ -487,12 +491,16 @@ func (v *ValidatorConfig) Adjust() error { | |||||||
| if v.MaxPendingRowCount == 0 { | ||||||||
| v.MaxPendingRowCount = DefaultValidatorMaxPendingRow | ||||||||
| } | ||||||||
| if v.EventCacheCount == 0 { | ||||||||
| v.EventCacheCount = defaultEventCacheCount | ||||||||
| } | ||||||||
| return nil | ||||||||
| } | ||||||||
|
|
||||||||
| func defaultValidatorConfig() ValidatorConfig { | ||||||||
| return ValidatorConfig{ | ||||||||
| Mode: ValidationNone, | ||||||||
| Mode: ValidationNone, | ||||||||
| EventCacheCount: defaultEventCacheCount, | ||||||||
| } | ||||||||
| } | ||||||||
|
|
||||||||
|
|
@@ -883,6 +891,9 @@ func (c *TaskConfig) adjust() error { | |||||||
| if inst.Syncer.QueueSize == 0 { | ||||||||
| inst.Syncer.QueueSize = defaultQueueSize | ||||||||
| } | ||||||||
| if inst.Syncer.EventCacheCount == 0 { | ||||||||
| inst.Syncer.EventCacheCount = defaultEventCacheCount | ||||||||
| } | ||||||||
| if inst.Syncer.CheckpointFlushInterval == 0 { | ||||||||
| inst.Syncer.CheckpointFlushInterval = defaultCheckpointFlushInterval | ||||||||
| } | ||||||||
|
|
@@ -1161,6 +1172,7 @@ type SyncerConfigForDowngrade struct { | |||||||
| WorkerCount int `yaml:"worker-count"` | ||||||||
| Batch int `yaml:"batch"` | ||||||||
| QueueSize int `yaml:"queue-size"` | ||||||||
| EventCacheCount int `yaml:"event-cache-count"` | ||||||||
| CheckpointFlushInterval int `yaml:"checkpoint-flush-interval"` | ||||||||
| MaxRetry int `yaml:"max-retry"` | ||||||||
| EnableGTID bool `yaml:"enable-gtid"` | ||||||||
|
|
@@ -1182,6 +1194,7 @@ func NewSyncerConfigsForDowngrade(syncerConfigs map[string]*SyncerConfig) map[st | |||||||
| WorkerCount: syncerConfig.WorkerCount, | ||||||||
| Batch: syncerConfig.Batch, | ||||||||
| QueueSize: syncerConfig.QueueSize, | ||||||||
| EventCacheCount: syncerConfig.EventCacheCount, | ||||||||
| CheckpointFlushInterval: syncerConfig.CheckpointFlushInterval, | ||||||||
| MaxRetry: syncerConfig.MaxRetry, | ||||||||
| EnableGTID: syncerConfig.EnableGTID, | ||||||||
|
|
||||||||
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.
It's good practice to add a comment explaining the purpose and impact of this default value, similar to
defaultQueueSize. This helps users understand the configuration better.