Add --with-proxysql flag to single sandbox deployment#47
Conversation
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds an opt-in --with-proxysql flag to the dbdeployer deploy single command so that a ProxySQL instance is deployed alongside a newly created single sandbox, using the existing sandbox.DeployProxySQLForTopology helper (single backend in hostgroup 0).
Changes:
- Add
--with-proxysqlpersistent flag todeploy single. - After creating the standalone sandbox, optionally deploy ProxySQL into a
proxysql/subdirectory using the single sandbox’s port from its sandbox description.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| origin := args[0] | ||
| if args[0] != sd.BasedirName { | ||
| origin = sd.BasedirName | ||
| } | ||
| sandboxDir := path.Join(sd.SandboxDir, defaults.Defaults().SandboxPrefix+common.VersionToName(origin)) | ||
| if sd.DirName != "" { | ||
| sandboxDir = path.Join(sd.SandboxDir, sd.DirName) |
There was a problem hiding this comment.
The sandbox directory calculation doesn’t match the logic used in sandbox.createSingleSandbox when sd.DirName is empty. In particular, if the user supplies --binary-version and the basedir directory name differs from sd.Version (e.g. basedir name contains dots or other characters), createSingleSandbox uses defaults.Defaults().SandboxPrefix + sd.BasedirName (no VersionToName conversion), but this code applies common.VersionToName(origin) and can point to a non-existent directory. Consider mirroring the exact directory naming logic from createSingleSandbox: if sd.DirName is empty, build the dir name based on whether sd.Version != sd.BasedirName and only apply VersionToName to sd.Version in the sd.Version == sd.BasedirName case.
| origin := args[0] | |
| if args[0] != sd.BasedirName { | |
| origin = sd.BasedirName | |
| } | |
| sandboxDir := path.Join(sd.SandboxDir, defaults.Defaults().SandboxPrefix+common.VersionToName(origin)) | |
| if sd.DirName != "" { | |
| sandboxDir = path.Join(sd.SandboxDir, sd.DirName) | |
| var sandboxDir string | |
| if sd.DirName != "" { | |
| // If a custom directory name was specified, use it directly. | |
| sandboxDir = path.Join(sd.SandboxDir, sd.DirName) | |
| } else { | |
| // Mirror the naming logic from createSingleSandbox when DirName is empty. | |
| prefix := defaults.Defaults().SandboxPrefix | |
| if sd.BasedirName != "" && sd.Version != sd.BasedirName { | |
| // When the basedir name differs from the version (e.g. provided via --binary-version), | |
| // use the basedir name as-is without applying VersionToName. | |
| sandboxDir = path.Join(sd.SandboxDir, prefix+sd.BasedirName) | |
| } else { | |
| // When the basedir name matches the version (or is empty), apply VersionToName to the version. | |
| sandboxDir = path.Join(sd.SandboxDir, prefix+common.VersionToName(sd.Version)) | |
| } |
Summary
--with-proxysqlflag todbdeployer deploy singlecommandcmd/replication.go, callingsandbox.DeployProxySQLForTopologywithnilfor slavePortsTest plan
dbdeployer deploy single --helpshows--with-proxysqlflagdbdeployer deploy single <version> --with-proxysqldeploys ProxySQL inproxysql/subdirectorydbdeployer deploy single <version>(without flag) still works as beforeCloses #41