Skip to content

Conversation

Kamlesh72
Copy link

Description

Fail the setup if initial_wait_time is 0 or negative

Fixes #492

Screenshots or Recordings

UI
Screenshot 2025-10-05 at 1 34 01 AM

CLI
Screenshot 2025-10-05 at 1 38 52 AM

@CLAassistant
Copy link

CLAassistant commented Oct 4, 2025

CLA assistant check
All committers have signed the CLA.

@vaibhav-datazip
Copy link
Collaborator

similar check needs to be added in Postgres as well

@Kamlesh72
Copy link
Author

@vaibhav-datazip Currently in postgres if User provide initial_wait_time to 0, we set it to default value ( 1200 ).

Instead of that, If User provide initial_wait_time we validate it [ 120, 2400 ].
If User doesn't provide initial_wait_time then we set to 1200.

Does that works?

found, _ := utils.IsOfType(p.config.UpdateMethod, "replication_slot")
if found {
logger.Info("Found CDC Configuration")
cdc := &CDC{}
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)
// check if initial wait time is valid or not
if cdc.InitialWaitTime < 120 || cdc.InitialWaitTime > 2400 {
return fmt.Errorf("the CDC initial wait time must be at least 120 seconds and less than 2400 seconds")
}

@vaibhav-datazip
Copy link
Collaborator

@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 vaibhav-datazip added the hacktoberfest Issues open for Hacktoberfest contributors label Oct 7, 2025
@Kamlesh72
Copy link
Author

@vaibhav-datazip Shouldn't we check cdcSupported only if user has provided initial_wait_time and fail setup if cdc is not supported ?

https://github.com/datazip-inc/olake/blob/a79f88af07fb97e3b9181d906585b7965e9172cf/drivers/mysql/internal/mysql.go#L121-130

@vaibhav-datazip
Copy link
Collaborator

@vaibhav-datazip Shouldn't we check cdcSupported only if user has provided initial_wait_time and fail setup if cdc is not supported ?

https://github.com/datazip-inc/olake/blob/a79f88af07fb97e3b9181d906585b7965e9172cf/drivers/mysql/internal/mysql.go#L121-130

exactly, if user has selected cdc mode instead of standalone mode (speaking in terms of UI), we should add a check that cdc conditions are met. If these condition checks fail then we should throw error, like binlog permissions alongwith correct cdc initial wait time.

@Kamlesh72
Copy link
Author

@vaibhav-datazip Added mysql permission check and postgres checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hacktoberfest Issues open for Hacktoberfest contributors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants