You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Snapshot restore fails when pgsql_tmp* directories exist in PGDATA #10398
During volume snapshot restore, the PGDATA cleanup step fails with "directory not empty" when non-empty directories matching pgsql_tmp* exist in the data directory.
This happens because RemoveRestoreExcludedFiles (from the machinery library) uses os.Remove to delete paths matched by the pgsql_tmp* glob pattern, which only works for files and empty directories. Extensions loaded via shared_preload_libraries (e.g. vchord) can create directories like pgsql_tmp_vchord_sampling/ in PGDATA during recovery, and the standard PostgreSQL pgsql_tmp/ directory may also contain temporary files.
Example error:
"msg":"restore error","error":"error while cleaning up the recovered PGDATA: remove /var/lib/postgresql/data/pgdata/pgsql_tmp_vchord_sampling: directory not empty"
Per PostgreSQL documentation, all pgsql_tmp* paths are ephemeral runtime artifacts that are excluded from pg_basebackup and cleaned up automatically on startup. They should be removed unconditionally during restore cleanup, regardless of whether they are files or directories.
Activity
feat(fileutils): remove directories matched by glob patterns in Remov…
fix(snapshot-restore): bump machinery to v0.4.0 for pgsql_tmp* direct…
fix(snapshot-restore): bump machinery to v0.4.0 for pgsql_tmp* direct…
fix(snapshot-restore): bump machinery to v0.4.0 for pgsql_tmp* direct…
fix(snapshot-restore): bump machinery to v0.4.0 for pgsql_tmp* direct…
fix(snapshot-restore): bump machinery to v0.4.0 for pgsql_tmp* direct…