<div dir="ltr"><div>Hi Christoph,</div><div><br></div><div>I'm glad to see that most of them are fixed and the rest seem to be fixed soon. For me isn't a problem anymore as I now know how to repair these things. But I feel other people will have a headache with these things, in special when dealing with Log Shipping / Hot standby setups.</div><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> both the unknown options and the systemd integration with</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> pg_upgradecluster have been fixed in the meantime; unfortunately not</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> in the jessie version of postgresql-common. Though if you say</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> 9.5, is that from<span class="inbox-inbox-Apple-converted-space"> </span></span><a href="http://apt.postgresql.org/" rel="noreferrer" class="gmail_msg" target="_blank" style="font-family:"helvetica neue",helvetica,arial,sans-serif">apt.postgresql.org</a><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">? If so, make sure to upgrade to</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> the postgresql-common version from there as well.</span><br><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">Yes, most probably is from <a href="http://apt.postgresql.org">apt.postgresql.org</a>. It is my preferred source for postgresql packages for my servers since a year ago.</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">This server was installed 4 months ago, and probably not upgraded since then. I'll do ASAP.</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> This has also been, well, addressed. It's not really fixable, see</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> /lib/systemd/system/postgresql</span><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">\@.service because of the way how</span><br class="gmail_msg" style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> instanced systemd service units work. pg_createcluster will now warn</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> if you create a cluster with a dash in the name.</span><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">At least it prints a warning. Some people will not </span><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">notice the text,</span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">this has happened to me several times. But as you said, is not </span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">fixable. I knew. </span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">> </span><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif">If you change start.conf, you need to "systemctl daemon-reload" to get</span></div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><div>> the generator symlinks updated.<br></div><div><br></div><div>In 9.5 start.conf doesn't say anything about this. But I've checked my 9.6 and it has the advise. So this was also fixed. </div><div>I didn't see this because I was still working with 9.5, and even in my office computer which runs debian testing I already have 9.6, i didn't have time yet to upgrade.</div><div><br></div><div>Anyway, thanks again for your work. I really appreciate it.</div><div><br></div></span><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div><div><span style="color:rgb(33,33,33);font-family:"helvetica neue",helvetica,arial,sans-serif"><br></span></div></div><br><div class="gmail_quote"><div dir="ltr">El jue., 6 oct. 2016 a las 20:11, Christoph Berg (<<a href="mailto:myon@debian.org">myon@debian.org</a>>) escribió:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Package: postgresql-common<br class="gmail_msg">
<br class="gmail_msg">
Re: deavid 2016-10-05 <CAFR-75vif=<a href="mailto:hSH5E3f2SQSXV39vkNjcZVk%2BKQ3ya2UN6P25RziQ@mail.gmail.com" class="gmail_msg" target="_blank">hSH5E3f2SQSXV39vkNjcZVk+KQ3ya2UN6P25RziQ@mail.gmail.com</a>><br class="gmail_msg">
> Hello Cristoph,<br class="gmail_msg">
><br class="gmail_msg">
> First of all, thank you a lot for your hard work on your tools for<br class="gmail_msg">
> postgresql clusters. It is very helpful indeed. PostgreSQL is a lot easier<br class="gmail_msg">
> to work with in Debian & Ubuntu thanks to those tools.<br class="gmail_msg">
><br class="gmail_msg">
> I want to inform you about an issue, maybe because several bugs or misuse<br class="gmail_msg">
> for my part. I don't know.<br class="gmail_msg">
><br class="gmail_msg">
> The issue itself can be explained as: init.d scripts manage a list of<br class="gmail_msg">
> servers/clusters different than the one in pg_lscluster.<br class="gmail_msg">
><br class="gmail_msg">
> The effect is always the same, I end with some special cluster which<br class="gmail_msg">
> doesn't start or stop when called from /etc/init.d/postgresql start/stop.<br class="gmail_msg">
> When I try to manually start it, it does without problems.<br class="gmail_msg">
><br class="gmail_msg">
> I had several talks in IRC on #postgres channel of Freenode, also i asked<br class="gmail_msg">
> on #debian and #debian-next and no one had a clue.<br class="gmail_msg">
><br class="gmail_msg">
> Finally I traced the problem. And it seems to be a lack of documentation,<br class="gmail_msg">
> and maybe some bugs. I could trace it thanks to your documentation in<br class="gmail_msg">
> README files of postgresql-common package, but I think it could be better<br class="gmail_msg">
> explained.<br class="gmail_msg">
><br class="gmail_msg">
> The problem lies in that init.d files rely on systemctl, which I don't know<br class="gmail_msg">
> how it works. Seems the second list is in<br class="gmail_msg">
> /var/run/systemd/generator/postgresql.service.wants/<br class="gmail_msg">
><br class="gmail_msg">
> I would recommend to add a tool to check this folder and do some repair,<br class="gmail_msg">
> and output a log of possible problems.<br class="gmail_msg">
><br class="gmail_msg">
> I've found 3 ways to get a broken list in systemd:<br class="gmail_msg">
><br class="gmail_msg">
> 1) Failed pg_upgradecluster due to failure on postgresql.conf migration:<br class="gmail_msg">
> From 9.3 to 9.5 several options have changed and older options are no<br class="gmail_msg">
> longer supported. If you have modified those options then they are<br class="gmail_msg">
> uncommented. Most notable is checkpoint_segments, which the default is too<br class="gmail_msg">
> low, and disappears in newer versions. When the script tries to finally<br class="gmail_msg">
> "start" the cluster, it fails, and forgots to update systemd services; so<br class="gmail_msg">
> when you manually fix postgresql.conf there's no way to "resume" the<br class="gmail_msg">
> upgrade.<br class="gmail_msg">
<br class="gmail_msg">
> On the pg_upgradecluster failure, is an old problem now. I believe it was<br class="gmail_msg">
> wheezy, so it should be version 134wheezy4 or similar.<br class="gmail_msg">
> For the other two, they ocurred this week on an updated Jessie system, so<br class="gmail_msg">
> they should be version 165+deb8u1<br class="gmail_msg">
<br class="gmail_msg">
Hi deavid,<br class="gmail_msg">
<br class="gmail_msg">
both the unknown options and the systemd integration with<br class="gmail_msg">
pg_upgradecluster have been fixed in the meantime; unfortunately not<br class="gmail_msg">
in the jessie version of postgresql-common. Though if you say<br class="gmail_msg">
9.5, is that from <a href="http://apt.postgresql.org" rel="noreferrer" class="gmail_msg" target="_blank">apt.postgresql.org</a>? If so, make sure to upgrade to<br class="gmail_msg">
the postgresql-common version from there as well.<br class="gmail_msg">
<br class="gmail_msg">
> 2) Placing a dash (-) in the cluster name. Seems its a separator for your<br class="gmail_msg">
> scripts. When you do this, pg_createcluster doesn't notice and continues,<br class="gmail_msg">
> leaving you with a working cluster that doesn't start on boot.<br class="gmail_msg">
<br class="gmail_msg">
This has also been, well, addressed. It's not really fixable, see<br class="gmail_msg">
/lib/systemd/system/postgresql\@.service because of the way how<br class="gmail_msg">
instanced systemd service units work. pg_createcluster will now warn<br class="gmail_msg">
if you create a cluster with a dash in the name.<br class="gmail_msg">
<br class="gmail_msg">
> 3) Using pg_renamecluster. It leaves old names in systemd.<br class="gmail_msg">
<br class="gmail_msg">
That item is still open, thanks for spotting.<br class="gmail_msg">
<br class="gmail_msg">
> I would recommend:<br class="gmail_msg">
> * Add --skip-systemctl-redirect to the man page of pg_ctlcluster. It is<br class="gmail_msg">
> useful for debug problems. I had to drill down through the perl scripts to<br class="gmail_msg">
> find the option. (I do not know perl)<br class="gmail_msg">
<br class="gmail_msg">
Aye.<br class="gmail_msg">
<br class="gmail_msg">
> * Document in pg_ctlcluster how to fix if one cluster doesn't start on boot.<br class="gmail_msg">
<br class="gmail_msg">
Possibly, will think about it.<br class="gmail_msg">
<br class="gmail_msg">
> What I did manually to fix this:<br class="gmail_msg">
> * Modified the names of symlinks in<br class="gmail_msg">
> /var/run/systemd/generator/postgresql.service.wants/<br class="gmail_msg">
<br class="gmail_msg">
"systemctl daemon-reload" should have done that (that's what was<br class="gmail_msg">
missing in the old pg_upgradecluster version).<br class="gmail_msg">
<br class="gmail_msg">
> * systemctl daemon-reload<br class="gmail_msg">
> * systemctl stop postgresql<br class="gmail_msg">
> * pg_lsclusters to see if anyone is still runing, and stop it with<br class="gmail_msg">
> "pg_ctlcluster --skip-systemctl-redirect"<br class="gmail_msg">
<br class="gmail_msg">
That was the other half of the breakage; the cluster would not be<br class="gmail_msg">
started via systemd during the upgrade.<br class="gmail_msg">
<br class="gmail_msg">
> * systemctl start postgresql<br class="gmail_msg">
> * pg_lsclusters to see if every cluster is running again.<br class="gmail_msg">
><br class="gmail_msg">
> I've checked a dozen times /etc/postgresql/9.5/*/start.conf ; but it has<br class="gmail_msg">
> its original contents. I tried "manual" and it doesn't help, so i put<br class="gmail_msg">
> "auto" again on it.<br class="gmail_msg">
<br class="gmail_msg">
If you change start.conf, you need to "systemctl daemon-reload" to get<br class="gmail_msg">
the generator symlinks updated.<br class="gmail_msg">
<br class="gmail_msg">
Christoph<br class="gmail_msg">
</blockquote></div>