Skip to content

Commit e00d5fd

Browse files
committed
Fix PG CI: relocate calc_redo_mb to genci, escape start cmd
Two bugs surfaced during WSL Ubuntu 24 E2E validation of the PG CI port: 1. calc_redo_mb was defined only in src/mariadb/mariaci.tcl, so loading src/postgresql/pgci.tcl without mariaci.tcl caused the start step to emit 'max_wal_size=MB' (empty value) and fail pg_ctl. Move calc_redo_mb to src/generic/genci.tcl next to calc_buffer_pool_mb so it is available to every RDBMS port. 2. In postgresql_start the pg_ctl command was passed to 'bash -c' without escaping the embedded double quotes (used by -D/-l/-o), producing a Tcl list-parse error. Apply the same string map escape pattern used by every other 'open |bash -c' invocation in pgci.tcl. Validated end-to-end on WSL Ubuntu 24.04 against postgres/postgres master: CLONE -> BUILD -> PACKAGE -> INSTALL -> INIT -> START -> PING -> CHANGE_PASSWORD -> TPROC-C OLTP -> SHUTDOWN all succeeded. Result: 71,999 NOPM / 165,731 PostgreSQL TPM (16 vusers).
1 parent c547d44 commit e00d5fd

3 files changed

Lines changed: 20 additions & 19 deletions

File tree

src/generic/genci.tcl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1336,6 +1336,24 @@ proc calc_buffer_pool_mb {} {
13361336
return $bp_mb
13371337
}
13381338

1339+
proc calc_redo_mb {} {
1340+
# derive from buffer pool
1341+
set bp_mb [calc_buffer_pool_mb]
1342+
1343+
if {$bp_mb <= 0} {
1344+
return 2048
1345+
}
1346+
1347+
# 25% of buffer pool
1348+
set redo_mb [expr {$bp_mb / 4}]
1349+
1350+
# range 2GB–32GB
1351+
if {$redo_mb < 2048} { set redo_mb 2048 }
1352+
if {$redo_mb > 32768} { set redo_mb 32768 }
1353+
1354+
return $redo_mb
1355+
}
1356+
13391357
# watcher
13401358
proc job_watcher {} {
13411359
if {$::watcher_running} {

src/mariadb/mariaci.tcl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,6 @@ proc mariadb_ci_id {cidict refname} {
1010
return $ci_id
1111
}
1212

13-
proc calc_redo_mb {} {
14-
# derive from buffer pool
15-
set bp_mb [calc_buffer_pool_mb]
16-
17-
if {$bp_mb <= 0} {
18-
return 2048
19-
}
20-
21-
# 25% of buffer pool
22-
set redo_mb [expr {$bp_mb / 4}]
23-
24-
# range 2GB–32GB
25-
if {$redo_mb < 2048} { set redo_mb 2048 }
26-
if {$redo_mb > 32768} { set redo_mb 32768 }
27-
28-
return $redo_mb
29-
}
30-
3113
proc mariadb_ci_safe_ref {refname} {
3214
# safe path part
3315
return [string map {/ _} $refname]

src/postgresql/pgci.tcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,8 +762,9 @@ proc postgresql_start {cidict refname} {
762762
}
763763

764764
set ::pipe_done 0
765+
set shell_safe_cmd [string map {\" \\\"} $full_cmd]
765766
if {[catch {
766-
set pipe [open "|bash -c \"$full_cmd\"" "r"]
767+
set pipe [open "|bash -c \"$shell_safe_cmd\"" "r"]
767768
fconfigure $pipe -blocking 0 -buffering line
768769
fileevent $pipe readable [list handle_output $pipe]
769770
after 30000 {set ::pipe_done 1}

0 commit comments

Comments
 (0)