Re: auto-sizing wal_buffers
От | Robert Haas |
---|---|
Тема | Re: auto-sizing wal_buffers |
Дата | |
Msg-id | AANLkTikpeVE-XMZL4L4Mi4zUd7S-D1JckO97_wjp8t3M@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: auto-sizing wal_buffers (Greg Smith <greg@2ndquadrant.com>) |
Ответы |
Re: auto-sizing wal_buffers
Re: auto-sizing wal_buffers |
Список | pgsql-hackers |
On Sat, Jan 15, 2011 at 11:52 AM, Greg Smith <greg@2ndquadrant.com> wrote: > Where I was expecting that setting to be "4" instead for 32kB. So there's > probably some minor bug left in where I inserted this into the > initialization sequence. So I started taking a look at this patch tonight with an eye to committing it, but ended up having to whack it around fairly hard to fix the problem described above: the problem is, I believe, that the initialization code in question doesn't run in every backend. My first thought was "gee, it's a bad idea for us to be manipulating the value of the GUC variable directly, I should use an assign_hook". But of course that turns out to be a bad idea, because there's no guarantee that wal_buffers will be initialized after shared_buffers. So I put it back the way you had it, and jiggered things so that the copy of the value that's actually used for memory allocation gets stored in XLogCtl. That made it possible to define a show_hook that DTRT, but that wasn't entirely straightforward either: the show_hook has to deliver the finished string, not just a replacement integer for guc.c to format. So I exposed the relevant formatting logic from guc.c as a separate function (duplicating that code didn't seem smart), and now it all seems to work. See attached, which also includes some other rewriting of code and docs that I hope constitute improvements. Barring screams of agony^W^W^Whelpful suggestions for how to code this more neatly, I'll go ahead and commit this. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
Вложения
В списке pgsql-hackers по дате отправления: