Re: pgstat_reset_remove_files ignores its argument
От
Jeff Janes
Тема
Re: pgstat_reset_remove_files ignores its argument
Дата
Msg-id
CAMkU=1zoiMWkYFZ+Q3Lo_F-GfcKh=MnAsAKyHKfBHU_YBm6S3g@mail.gmail.com
Ответ на
Re: pgstat_reset_remove_files ignores its argument (Robert Haas)
Список
Дерево обсуждения
pgstat_reset_remove_files ignores its argument Jeff Janes <jeff.janes@gmail.com>
Re: pgstat_reset_remove_files ignores its argument Robert Haas <robertmhaas@gmail.com>
Re: pgstat_reset_remove_files ignores its argument Tomas Vondra <tv@fuzzy.cz>
Re: pgstat_reset_remove_files ignores its argument Jeff Janes <jeff.janes@gmail.com>
Re: pgstat_reset_remove_files ignores its argument Alvaro Herrera <alvherre@2ndquadrant.com>
On Fri, Aug 16, 2013 at 12:38 PM, Robert Haas wrote: > On Wed, Aug 14, 2013 at 12:13 AM, Jeff Janes wrote: >> in 9.3 and 9.4, pgstat_reset_remove_files uses the global variable >> pgstat_stat_directory rather than the argument it is passed, "directory". >> On crash recovery, this means the tmp directory gets cleared twice and the >> permanent pg_stat doesn't get cleared at all. >> >> It seems like the obvious one line change would fix it, but I haven't tested >> it because I don't know how to cause a crash without pg_stat already being >> empty. > > I think there are three lines to change, as in the attached patch. > > Am I wrong? No, you are right, I too realized I missed a couple more spots. Your patch looks just like the one I eventually arrived at, before I got distracted thinking about how to implement the regex /^(global|db_\d+)\.stat$/ in C and forgot to post a correction. Is the regex code in src/backend/regex allowed to be used from "flat" C code, or does it have to be in the context of a transaction, memory context, etc.? Cheers, Jeff
В списке pgsql-hackers по дате отправления
От: Josh Berkus
Дата: