Skip to content

Commit b95ada1

Browse files
committed
Do not configure JIT for the monitoring user
PostgreSQL 10 does not have a "jit" parameter. The current release of pgMonitor includes this fix and correctly applies it to specific versions of PostgreSQL. This partially reverts commit df492f1. Issue: [sc-15755] See: CrunchyData/pgmonitor#295
1 parent d8a2803 commit b95ada1

File tree

4 files changed

+2
-10
lines changed

4 files changed

+2
-10
lines changed

internal/controller/postgrescluster/pgmonitor_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ func TestReconcilePGMonitorExporterStatus(t *testing.T) {
441441
podExecCalled: false,
442442
// Status was generated manually for this test case
443443
// TODO jmckulk: add code to generate status
444-
status: v1beta1.MonitoringStatus{ExporterConfiguration: "5dbc557689"},
444+
status: v1beta1.MonitoringStatus{ExporterConfiguration: "74476b9895"},
445445
statusChangedAfterReconcile: false,
446446
}} {
447447
t.Run(test.name, func(t *testing.T) {

internal/pgmonitor/postgres.go

+1-7
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func DisableExporterInPostgreSQL(ctx context.Context, exec postgres.Executor) er
8686
// EnableExporterInPostgreSQL runs SQL setup commands in `database` to enable
8787
// the exporter to retrieve metrics. pgMonitor objects are created and expected
8888
// extensions are installed. We also ensure that the monitoring user has the
89-
// current password, optimal config and can login.
89+
// current password and can login.
9090
func EnableExporterInPostgreSQL(ctx context.Context, exec postgres.Executor,
9191
monitoringSecret *corev1.Secret, database, setup string) error {
9292
log := logging.FromContext(ctx)
@@ -138,12 +138,6 @@ func EnableExporterInPostgreSQL(ctx context.Context, exec postgres.Executor,
138138
// password; update the password and ensure that the ROLE
139139
// can login to the database
140140
`ALTER ROLE :"username" LOGIN PASSWORD :'verifier';`,
141-
142-
// disable JIT for only ccp_monitoring user's context to prevent:
143-
// - slow executing due unnecessary inlining, optimization and emission
144-
// - memory leak due to re-creating struct types during inlining
145-
// and allow to enable JIT for other database users transparently
146-
`ALTER ROLE :"username" SET jit = off;`,
147141
}, "\n"),
148142
map[string]string{
149143
"database": database,

testing/kuttl/e2e/exporter/01--check-exporter.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ commands:
4141
BEGIN
4242
SELECT * INTO result FROM pg_catalog.pg_roles WHERE rolname = 'ccp_monitoring';
4343
ASSERT FOUND, 'user not found';
44-
ASSERT result.rolconfig @> '{jit=off}', format('got config: %L', result.rolconfig);
4544
END $$
4645
SQL

testing/kuttl/e2e/exporter/11--check-exporter-tls.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ commands:
4141
BEGIN
4242
SELECT * INTO result FROM pg_catalog.pg_roles WHERE rolname = 'ccp_monitoring';
4343
ASSERT FOUND, 'user not found';
44-
ASSERT result.rolconfig @> '{jit=off}', format('got config: %L', result.rolconfig);
4544
END $$
4645
SQL

0 commit comments

Comments
 (0)