In the past naming of functions, variables and such didn't really have a naming scheme. Now they should have.
We have a nice little abstraction for snprintf with covering the case that a string is too big for the target buffer – let's use that!
fix: store the master connection user name on standby follow
Some compiles complain about not checking the return value of freopen(), so we check it
Now repmgr.repmgrd.default has another option: REPMGRD_ENABLED. Valid values are either yes or no.
The leak is irrelevant
Now we should be able to distinguish different events more easily
This will avoid CloseConnections() to try to close an already closed connection.
repmgr repl_status had the column time_lag which was documented to be the time a standby is behind master. In fact it only works like this when viewed on the standby and not on the master: there it only was the time of the last status update. We dropped that column and replaced it by a new column „communication_time_lag“ which is the content of the repl_status column on the master. On the standby we contain the time of the last update in shared mem though refer always to the correct time nonetheless where repl_status is queried. We also added a new column, „replication_time_lag“, which refers to the apply delay.
wait_connection_availability() did take at least 2 seconds per call in the old incarnation. Now we may finish a call without any sleep at all when the result is already ready at the time called
We had the problem that the log file appeared empty for a long time due to file buffers. Thus we call fflush() after every log message so the log file gets written out to disk quickly
fixing several calls where we did not check the result status but only the return value; the query may fail nonetheless
Autofailover is an experimental feature which should not be enabled by default. The user has to be aware of what he is doing when enabling it.
Now it properly aligns and breaks at 78 characters.