I was trying to simply standby clone. Pretty basic. But I was getting a “segmentation fault”, no further log output.

I didn’t know what a segfault is, so I googled it:

A segmentation fault  occurs when a program attempts to access a memory location that it is  not allowed to access, or attempts to access a memory location in a way  that is not allowed (for example, attempting to write to a read-only  location, or to overwrite part of the operating system)

It hit me that prior to running the standby clone that I had run rm -rf $PGDATA . So, repmgr was trying to standby clone writing into a nonexisting directory. The simple fix was mkdir -p $PGDATA , and on subsequent runs, using rm -rf $PGDATA/* instead.

--

--

In our production system we have repmgr for managing failover for our Postgres databases. However, in one incident we had a while ago, our Primary (master) node went down due to a network problem, and repmgr didn’t perform the failover as expected. On reviewing the logs we saw that one of the standby(slave) instances recognized the master failure, and initiated a vote, but the other nodes ignored it and no failover occurred.

Eventually we discovered the reason why- the “ignoring” nodes and the primary server were all on the same physical compute. (In an Openstack cloud environment). This may be worth looking into!

--

--

This was really irritating.

I was trying to run a very simple ansible playbook, in fact, just one template task, to generate a file. But when I tried running it, I kept getting:

[WARNING]: Unable to parse /home/kobi/inv_file as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is…

--

--

Kobi Rosenstein

Kobi Rosenstein

Devops DBA. This blog chronicles my “gotcha” moments — Each post contains an answer I would have like to have found when searching for those pesky errors I get.