Skip to content

2.27.0.0-b386

@druzac druzac tagged this 30 Jul 15:59
Summary:
D42385 added logic to print the actual value of the path of the initdb error file. This logic is in prod code but tries to access an environment variable set only in tests. Furthermore, the log replacement is defeated by post test log processing which replaces every literal occurrence of some environment variables with the name of the environment variable, so the replacement does not actually work.

The value of `TEST_TMPDIR` is printed out at the bottom of log output, so someone debugging can manually create the initdb file path by doing the substitution themselves.
Jira: DB-15665

Test Plan:
Used this diff to examine log lines:
```
diff --git a/src/postgres/src/backend/access/transam/xlog.c b/src/postgres/src/backend/access/transam/xlog.c
index 1adc67d5d5..d976e10ccc 100644
--- a/src/postgres/src/backend/access/transam/xlog.c
+++ b/src/postgres/src/backend/access/transam/xlog.c
@@ -3964,6 +3964,7 @@ WriteControlFile(void)

        fd = BasicOpenFile(XLOG_CONTROL_FILE,
                                           O_RDWR | O_CREAT | O_EXCL | PG_BINARY);
+       fd = -1;
        if (fd < 0)
                ereport(PANIC,
                                (errcode_for_file_access(),
```

Reviewers: hsunder, aagrawal

Reviewed By: hsunder, aagrawal

Subscribers: ybase, yql, slingam

Differential Revision: https://phorge.dev.yugabyte.com/D45659
Assets 2
Loading