New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wal-g symlink postgresql.conf outside of target directory #1576
Comments
Hi! Generally, we expect PGDATA to be empty before restore. In this particular case we can do special actions of checking symlink, but it's kind of unwanted exception. It seems to me we must add check that directory is empty before fetching backup. |
PGDATA was empty at the beginning of the restore process. wal-g tried to create the symlink. I do think the correct solution would be to not check if the symlink target exists at all. Just check that the symlink was recovered, but ignore the target. The target could be a file that will be later recovered by wal-g, but it could also be a file that will not be recovered at all because it is managed outside of PGDATA dir. |
I clarified the steps to reproduce part. |
Uhm...I see. Seems like a bug. |
@usernamedt I think we could recruit someone from university to fix this. Do we have some kind of special tag for such bugs? TLDR: recovery fails if backup contains symlink to nonexistent external file. |
@x4m Is there a way to ignore errors and just continue with the recovery? |
I have found a workaround. Shall the https://github.com/wal-g/wal-g/blob/master/internal/extract.go#L78C6-L78C19 |
Database name
postgresql v15
Issue description
Describe your problem
The symlink does indeed exist, but the target of the file does not exist. And the target also cannot be created. The expected behavior would be that,
wal-g
checks only if the symlink exists, but not if the target exists. Because the target is outside/var/lib/postgresql/15/
.Please provide steps to reproduce
postgresql.conf
outside of/var/lib/postgresql/15/
.Please add config and wal-g stdout/stderr logs for debug purpose
If you can, provide logs
There are no other error messages above.
The text was updated successfully, but these errors were encountered: