Skip to content

Commit 56f2cc8

Browse files
committed
Start using absolute path for clear ptrack control file.
1 parent d1ce2ab commit 56f2cc8

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/backend/access/heap/ptrack.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,16 @@ SetPtrackClearLSN(bool set_invalid)
350350
{
351351
int fd;
352352
XLogRecPtr ptr;
353+
char file_path[MAXPGPATH];
353354
if (set_invalid)
354355
ptr = InvalidXLogRecPtr;
355356
else
356357
ptr = GetXLogInsertRecPtr();
357-
//LWLockAcquire(ControlFileLock, LW_EXCLUSIVE);
358-
fd = BasicOpenFile("global/ptrack_control",
358+
359+
join_path_components(file_path, DataDir, "global/ptrack_control");
360+
canonicalize_path(file_path);
361+
362+
fd = BasicOpenFile(file_path,
359363
O_RDWR | O_CREAT | PG_BINARY,
360364
S_IRUSR | S_IWUSR);
361365
if (fd < 0)
@@ -384,7 +388,6 @@ SetPtrackClearLSN(bool set_invalid)
384388
ereport(PANIC,
385389
(errcode_for_file_access(),
386390
errmsg("could not close ptrack control file: %m")));
387-
//LWLockRelease(ControlFileLock);
388391
}
389392

390393
/* Test ptrack file */

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy