My reason for killing the process is to test behavior in the event of an unclean shutdown.
In the test, I made sure the former primary is being demoted to standby.
To keep things simple, I have repeated the test without restarting the former primary, and without pormoting the stby.
Before killing the main pg server process, both primary and stby have 00065 as the latest segment, under pg_wal
This time all I did is "sudo pkill postmaster", after which under pg_wal
On the stby the latest segment is still 00064, while on the primary it is now 00065
Which means a process continues to run on the primary and creates the next WAL segment (...65). Is this expected? and why?