-
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?
Conversation
|
similar check needs to be added in Postgres as well |
|
@vaibhav-datazip Currently in postgres if User provide Instead of that, If User provide Does that works? olake/drivers/postgres/internal/postgres.go Lines 101 to 114 in 1001235
|
|
@Kamlesh72 , one more check needs to be added here , if cdc config is selected and Olake mysql cdc setup permissions are missing or not granted, then too the check should fail when clicked next |
|
@vaibhav-datazip Shouldn't we check cdcSupported only if user has provided |
exactly, if user has selected |
|
@vaibhav-datazip Added mysql permission check and postgres checks. |
| return false, nil | ||
| return false, fmt.Errorf(warnMessage) |
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
| // Enable CDC support if binlog is configured | |
| cdcSupported, err := m.IsCDCSupported(ctx) | |
| if err != nil { | |
| return err | |
| } |
So if error occurs, user can see error like binlog_format is not set to ROW
| // 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") | ||
| if !userProvided { | ||
| cdc.InitialWaitTime = 1200 | ||
| logger.Infof("CDC initial wait time not provided by user, defaulting to %d", cdc.InitialWaitTime) | ||
| } |
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.
any reason for this change ?
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.
If user leave Initial wait time field empty, we set to 1200.
If user enters any value ( including 0 ), then only we validate.
So if user enters 0, I thought we shouldn't silently change that to 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 comment
The 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
SELECT name, setting FROM pg_settings
WHERE name IN ('wal_level', 'max_replication_slots', 'max_wal_senders');
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.
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 comment
The 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 comment
The reason will be displayed to describe this comment to others. Learn more.
any updates on this @Kamlesh72 ?
|
hi @Kamlesh72 , will be closing this PR if you are no longer working on this |
|
@vaibhav-datazip I will surely merge it this week. Sorry for the delay. |
okay then, no problem . please resolve the merge conflicts and acknowledge the previous comments |
Description
Fail the setup if initial_wait_time is 0 or negative
Fixes #492
Screenshots or Recordings
UI

CLI
