I was under the impression that WAL segments files are normally generated before they are being written to and archived, and are continuously renamed and reused to save disk space. I was wondering if I safely assume that when restoring these unarchived WAL segments, they are renamed to match that of the database's current timeline?
All of the files from 00000004...13 to 00000004...19 previously had the timeline ID of 1 (00000001...13 to 00000001...19 respectively), and these were placed in the pg_wal directory before the restore process was executed.
Whenever an archive recovery completes, a new timeline is created to identify the series of WAL records generated after that recovery.
Since these WAL segments were generated in a previous timeline but were never written to, does this allow Postgres to rename those same WAL files to match that of the current timeline without any issues?