Обсуждение: vacuum fails with "could not open statistics file" "Device orresource busy"

Поиск
Список
Период
Сортировка

vacuum fails with "could not open statistics file" "Device orresource busy"

От
Andres Freund
Дата:
Hi,

buildfarm member lorikeet had an interesting buildfarm failure in the
logical decoding test. The failure looks unrelated to logical decoding,
but might be more widely relevant:

https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2018-10-19%2011%3A22%3A34
  VACUUM FULL pg_class;
+ WARNING:  could not open statistics file "pg_stat_tmp/global.stat": Device or resource busy

Now that animal is cygwin based, so maybe it's just some random
weirdness. But ISTM it could also indicate a bug of some sort.

Were it native windows, I'd assume we'd keep a file open with the wrong
flags or such...

Greetings,

Andres Freund


Re: vacuum fails with "could not open statistics file" "Device orresource busy"

От
Tomas Vondra
Дата:
Hi,

On 10/20/2018 04:15 AM, Andres Freund wrote:
> Hi,
> 
> buildfarm member lorikeet had an interesting buildfarm failure in the
> logical decoding test. The failure looks unrelated to logical decoding,
> but might be more widely relevant:
> 
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2018-10-19%2011%3A22%3A34
>   VACUUM FULL pg_class;
> + WARNING:  could not open statistics file "pg_stat_tmp/global.stat": Device or resource busy
> 
> Now that animal is cygwin based, so maybe it's just some random
> weirdness. But ISTM it could also indicate a bug of some sort.
> 
> Were it native windows, I'd assume we'd keep a file open with the wrong
> flags or such...
> 

Interesting. After a bit more digging, I've found these two places
discussing stats files and "device or resource busy":

[1] https://www.postgresql.org/message-id/flat/51B59794.3000500%40gmail.com

[2]
https://stackoverflow.com/questions/30846804/postgresql-statistics-issue-could-not-rename-temporary-statistics-file

The pgsql-hackers thread is clearly about cygwin (see the diff file).
Not sure about the SO thread, it only talks about 9.4 on windows (but I
guess it's cygwin too).

That being said, I'm not sure how to trigger it - my guess is it happens
when one process holds a file descriptor open while another process
tries to remove it, but I find it strange we'd only seen this twice
since 2013.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: vacuum fails with "could not open statistics file" "Device orresource busy"

От
Andrew Dunstan
Дата:

On 10/19/2018 10:15 PM, Andres Freund wrote:
> Hi,
>
> buildfarm member lorikeet had an interesting buildfarm failure in the
> logical decoding test. The failure looks unrelated to logical decoding,
> but might be more widely relevant:
>
> https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=lorikeet&dt=2018-10-19%2011%3A22%3A34
>    VACUUM FULL pg_class;
> + WARNING:  could not open statistics file "pg_stat_tmp/global.stat": Device or resource busy
>
> Now that animal is cygwin based, so maybe it's just some random
> weirdness. But ISTM it could also indicate a bug of some sort.
>
> Were it native windows, I'd assume we'd keep a file open with the wrong
> flags or such...
>




I have switched the stats_temp_dir of this animal to a Windows Ramdisk. 
Lets' see if the problem persists.

cheers

andrew