-
Notifications
You must be signed in to change notification settings - Fork 1
feat: add InnoDB Cluster topology (#58) #63
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
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 | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -136,12 +136,24 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||
| PG_FULL=$(ls ~/opt/postgresql/ | head -1) | ||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Deploying PostgreSQL $PG_FULL replication + ProxySQL ===" | ||||||||||||||||||||||||||||||||||||||||||||
| ./dbdeployer deploy replication "$PG_FULL" --provider=postgresql --with-proxysql | ||||||||||||||||||||||||||||||||||||||||||||
| SBDIR=$(ls -d ~/sandboxes/postgresql_repl_*) | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Check ProxySQL is running ===" | ||||||||||||||||||||||||||||||||||||||||||||
| ~/sandboxes/postgresql_repl_*/proxysql/status | ||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Check ProxySQL admin interface ===" | ||||||||||||||||||||||||||||||||||||||||||||
| ~/sandboxes/postgresql_repl_*/proxysql/use -e "SELECT * FROM pgsql_servers;" || true | ||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Connect through ProxySQL (may fail - pgsql auth config is WIP) ===" | ||||||||||||||||||||||||||||||||||||||||||||
| ~/sandboxes/postgresql_repl_*/proxysql/use_proxy -c "SELECT 1;" || echo "WARN: ProxySQL pgsql proxy connection failed (expected - auth config WIP)" | ||||||||||||||||||||||||||||||||||||||||||||
| $SBDIR/proxysql/status | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Check ProxySQL has pgsql_servers configured ===" | ||||||||||||||||||||||||||||||||||||||||||||
| $SBDIR/proxysql/use -e "SELECT * FROM pgsql_servers;" || true | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| echo "=== Functional test: verify PostgreSQL replication works ===" | ||||||||||||||||||||||||||||||||||||||||||||
| $SBDIR/primary/use -c "CREATE TABLE proxy_test(id serial, val text); INSERT INTO proxy_test(val) VALUES ('pg_proxysql_test');" | ||||||||||||||||||||||||||||||||||||||||||||
| sleep 2 | ||||||||||||||||||||||||||||||||||||||||||||
| RESULT=$($SBDIR/replica1/use -c "SELECT val FROM proxy_test;" 2>&1) | ||||||||||||||||||||||||||||||||||||||||||||
| echo "$RESULT" | ||||||||||||||||||||||||||||||||||||||||||||
| echo "$RESULT" | grep -q "pg_proxysql_test" || { echo "FAIL: PG replication not working"; exit 1; } | ||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+144
to
+152
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. Tighten this verification block so it actually catches regressions. The 🧪 One way to harden the check- $SBDIR/proxysql/use -e "SELECT * FROM pgsql_servers;" || true
+ $SBDIR/proxysql/use -e "SELECT * FROM pgsql_servers;"
echo "=== Functional test: verify PostgreSQL replication works ==="
$SBDIR/primary/use -c "CREATE TABLE proxy_test(id serial, val text); INSERT INTO proxy_test(val) VALUES ('pg_proxysql_test');"
- sleep 2
- RESULT=$($SBDIR/replica1/use -c "SELECT val FROM proxy_test;" 2>&1)
+ for _ in $(seq 1 15); do
+ RESULT=$($SBDIR/replica1/use -c "SELECT val FROM proxy_test;" 2>&1 || true)
+ echo "$RESULT" | grep -q "pg_proxysql_test" && break
+ sleep 1
+ done
echo "$RESULT"
echo "$RESULT" | grep -q "pg_proxysql_test" || { echo "FAIL: PG replication not working"; exit 1; }📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||
| echo "OK: PostgreSQL replication verified with ProxySQL deployed" | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| echo "=== ProxySQL proxy connection test (pgsql auth WIP) ===" | ||||||||||||||||||||||||||||||||||||||||||||
| $SBDIR/proxysql/use_proxy -c "SELECT 1;" || echo "WARN: ProxySQL pgsql proxy connection failed (expected - auth config WIP)" | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| - name: Cleanup | ||||||||||||||||||||||||||||||||||||||||||||
| if: always() | ||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -241,6 +241,8 @@ func replicationSandbox(cmd *cobra.Command, args []string) { | |||||||||||||||
| globals.NdbLabel) | ||||||||||||||||
|
|
||||||||||||||||
| } | ||||||||||||||||
| skipRouter, _ := flags.GetBool(globals.SkipRouterLabel) | ||||||||||||||||
|
||||||||||||||||
| skipRouter, _ := flags.GetBool(globals.SkipRouterLabel) | |
| skipRouter, _ := flags.GetBool(globals.SkipRouterLabel) | |
| if skipRouter && topology != globals.InnodbClusterLabel { | |
| common.Exitf(1, "option '%s' can only be used with '%s' topology ", | |
| globals.SkipRouterLabel, | |
| globals.InnodbClusterLabel) | |
| } |
Copilot
AI
Apr 2, 2026
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.
--with-proxysql wiring later in this function computes the created sandbox directory using the master/slave prefix (MasterSlavePrefix). With the new innodb-cluster topology using InnoDBClusterPrefix, ProxySQL deployment will look in the wrong directory and fail when both --topology=innodb-cluster and --with-proxysql are used. Consider deriving sandboxDir from the selected topology (or reading it from the sandbox catalog/description after deployment) instead of assuming master/slave.
Copilot
AI
Apr 2, 2026
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.
There is extensive testscript coverage for existing replication topologies (e.g., ts/templates/group/group.tmpl, ts/templates/replication/replication.tmpl), but no automated coverage for the new --topology=innodb-cluster flow. Consider adding a testscript smoke test that deploys with --topology=innodb-cluster --skip-router --skip-start using a mock basedir that includes a stub mysqlsh binary, and asserts that the expected scripts (init_cluster, check_cluster, etc.) are generated.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: ProxySQL/dbdeployer
Length of output: 3092
🏁 Script executed:
Repository: ProxySQL/dbdeployer
Length of output: 4158
🏁 Script executed:
Repository: ProxySQL/dbdeployer
Length of output: 1215
🏁 Script executed:
Repository: ProxySQL/dbdeployer
Length of output: 45
🏁 Script executed:
Repository: ProxySQL/dbdeployer
Length of output: 45
MySQL Shell libraries are not copied during installation.
The MySQL Shell step only copies the
mysqlshbinary but omits the bundled libraries (lib/directory), which include authentication plugins and the Python 3.9 runtime. In contrast, the MySQL Router step (line 269) copies both the binary and libraries usingcp -r "$ROUTER_DIR/lib/.". This inconsistency should be corrected to ensure MySQL Shell has all required dependencies at runtime.Apply consistent library copying
SHELL_DIR=$(ls -d /tmp/mysql-shell-${MYSQL_VERSION}* | head -1) cp "$SHELL_DIR/bin/mysqlsh" "$SANDBOX_BINARY/${MYSQL_VERSION}/bin/" + cp -r "$SHELL_DIR/lib/." "$SANDBOX_BINARY/${MYSQL_VERSION}/lib/" 2>/dev/null || true echo "mysqlsh installed at $SANDBOX_BINARY/${MYSQL_VERSION}/bin/mysqlsh"📝 Committable suggestion
🤖 Prompt for AI Agents