Hi,
I would like to propose a patch that removes the duplicate code
setting database state in the control file.
The patch is straightforward but the only concern is that in
StartupXLOG(), SharedRecoveryState now gets updated only with spin
lock; earlier it also had ControlFileLock in addition to that. AFAICU,
I don't see any problem there, since until the startup process exists
other backends could not connect and write a WAL record.
Regards,
Amul Sul.
EDB: http://www.enterprisedb.com