Skip to content

Commit 1481128

Browse files
committed
fix: Router port extraction includes config file path
The ls ... && grep ... pipeline captured both the ls output (file path) and the grep output (port number) into ROUTER_RW_PORT, resulting in mysql receiving "/path/to/mysqlrouter.conf\n6446" as the port value. Fixed by removing the unnecessary ls check — grep already handles missing files via 2>/dev/null.
1 parent 2cc282d commit 1481128

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/integration_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ jobs:
615615
echo "$RESULT" | grep -q "hello_from_primary" || { echo "FAIL: data not replicated to node3 after 20s"; exit 1; }
616616
617617
echo "=== Functional test: connect through MySQL Router (R/W) ==="
618-
ROUTER_RW_PORT=$(ls $SBDIR/router/mysqlrouter.conf 2>/dev/null && grep -A5 '\[routing:bootstrap_rw\]' $SBDIR/router/mysqlrouter.conf | grep 'bind_port' | awk -F= '{print $2}' | tr -d ' ' || echo "")
618+
ROUTER_RW_PORT=$(grep -A5 '\[routing:bootstrap_rw\]' $SBDIR/router/mysqlrouter.conf 2>/dev/null | grep 'bind_port' | awk -F= '{print $2}' | tr -d ' ')
619619
if [ -n "$ROUTER_RW_PORT" ]; then
620620
echo "Router R/W port: $ROUTER_RW_PORT"
621621
$SBDIR/node1/use -h 127.0.0.1 -P "$ROUTER_RW_PORT" -e "INSERT INTO ic_test.t1 (val) VALUES ('via_router');"
@@ -634,7 +634,7 @@ jobs:
634634
fi
635635
636636
echo "=== Functional test: connect through MySQL Router (R/O) ==="
637-
ROUTER_RO_PORT=$(ls $SBDIR/router/mysqlrouter.conf 2>/dev/null && grep -A5 '\[routing:bootstrap_ro\]' $SBDIR/router/mysqlrouter.conf | grep 'bind_port' | awk -F= '{print $2}' | tr -d ' ' || echo "")
637+
ROUTER_RO_PORT=$(grep -A5 '\[routing:bootstrap_ro\]' $SBDIR/router/mysqlrouter.conf 2>/dev/null | grep 'bind_port' | awk -F= '{print $2}' | tr -d ' ')
638638
if [ -n "$ROUTER_RO_PORT" ]; then
639639
echo "Router R/O port: $ROUTER_RO_PORT"
640640
RESULT=$($SBDIR/node1/use -h 127.0.0.1 -P "$ROUTER_RO_PORT" -e "SELECT val FROM ic_test.t1 WHERE val='hello_from_primary';" 2>&1) || true

0 commit comments

Comments
 (0)