Hello guys, I was working on pgmoneta, specifically on a new project where we can filter some actions that happened after a certain backup was taken. You can take a look at it here <https://github.com/pgmoneta/pgmoneta/discussions/630> to get some context. Currently, I am in the phase where I have read some WAL files, removed the records I don't want from them, and the next step is to write them back to disk. If I started with these WAL files: ``` file 1: 10 records file 2: 10 records file 3: 10 records file 4: 10 records ``` and after filtering, I ended up with these files: ``` file 1: 8 records file 2: 5 records file 3: 10 records file 4: 3 records ```
Can I just write these files with their current number of records, leaving gaps where there are fewer records, while maintaining the 16MB/file constraint (or `--wal-segsize`, whatever the value)? Or do I need to compact them to fill each file completely? In the first option, I would write some records and zero-pad the rest of the file.