-
Notifications
You must be signed in to change notification settings - Fork 138
fix(mysql): enforce non-zero initial wait time for CDC setup #563
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: staging
Are you sure you want to change the base?
Changes from all commits
c57fa8c
f5ce0a8
95ff724
3c428a1
e711a0c
93a6da4
0c3cad6
88e335e
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 |
|---|---|---|
|
|
@@ -105,8 +105,13 @@ func (p *Postgres) Setup(ctx context.Context) error { | |
| if err := utils.Unmarshal(p.config.UpdateMethod, cdc); err != nil { | ||
| return err | ||
| } | ||
| // set default value | ||
| cdc.InitialWaitTime = utils.Ternary(cdc.InitialWaitTime == 0, 1200, cdc.InitialWaitTime).(int) | ||
|
|
||
| // Set initial_wait_time to 1200 if not provided by user | ||
| userProvided, _ := utils.IsOfType(p.config.UpdateMethod, "initial_wait_time") | ||
|
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. also why no query based check is added in postgres side. you can visit the olake documentation on how to verify cdc configurations 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. My mistake I didnt checked that. I will include it in code. 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. Will update this by tomorrow ( saturday ). 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. any updates on this @Kamlesh72 ? |
||
| if !userProvided { | ||
| cdc.InitialWaitTime = 1200 | ||
| logger.Infof("CDC initial wait time not provided by user, defaulting to %d", cdc.InitialWaitTime) | ||
| } | ||
|
Comment on lines
-108
to
+114
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. any reason for this change ? 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 user leave So if user enters 0, I thought we shouldn't silently change that to default value. |
||
|
|
||
| // check if initial wait time is valid or not | ||
| if cdc.InitialWaitTime < 120 || cdc.InitialWaitTime > 2400 { | ||
|
|
||
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.
why Is this change done ??
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.
olake/drivers/mysql/internal/mysql.go
Lines 135 to 139 in 93a6da4
So if error occurs, user can see error like
binlog_format is not set to ROW