Re: create database hangs forever on WSL - autovacuum deadlock? - Mailing list pgsql-general

From Thomas Munro
Subject Re: create database hangs forever on WSL - autovacuum deadlock?
Date
Msg-id CA+hUKG+7S+2wOi9fqdMT9cpDct7v9K86u+0OTDg23KTvt_YfJA@mail.gmail.com
Whole thread Raw
In response to Re: create database hangs forever on WSL - autovacuum deadlock?  (Alicja Kucharczyk <zaledwie10minut@gmail.com>)
List pgsql-general
On Sun, Jan 9, 2022 at 2:15 PM Alicja Kucharczyk
<zaledwie10minut@gmail.com> wrote:
> sob., 8 sty 2022 o 22:40 Thomas Munro <thomas.munro@gmail.com> napisał(a):
>> On Sat, Jan 8, 2022 at 8:11 PM Alicja Kucharczyk
>> <zaledwie10minut@gmail.com> wrote:
>> > this is postgres running on windows wsl:  PostgreSQL 14.1 (Ubuntu 14.1-1.pgdg18.04+1) on x86_64-pc-linux-gnu,
compiledby gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0, 64-bit 
>>
>> Is this WSL1 (some kind of Linux system call emulator running on an NT
>> kernel) or WSL2 (some kind of virtual machine running a Linux kernel)?
>
>
>  lookd like WSL1:
>   NAME      STATE           VERSION
> * Ubuntu    Running         1

I don't think you're going to like this answer.  In PostgreSQL 14, we
started using a signalfd in an epoll set (multiplexed with other fds
for sockets etc) to receive "latch wakeups".  This works pretty well
on a real Linux kernel, but apparently it is not emulated well enough
to work on WSL1.  I don't know the exact reason why, but if someone
can figure it out I'd be interested in seeing if we can fix it (though
I thought everyone moved to WSL2 which has none of these problems?).
There is a WSL1 machine in the build farm, but it's using
-DWAIT_USE_POLL to avoid this problem; that's useless if you're trying
to run with stock PostgreSQL packages from Ubuntu or whatever, though,
it only helps if you compile from source.  For what it's worth,
running PostgreSQL compiled for Windows using Wine on a Unix system
also fails in various ways.  It turns out that emulating a foreign
kernel is super hard...  Previous discussion:

https://www.postgresql.org/message-id/flat/CAEP4nAymAZP1VEBNoWAQca85ZtU5YxuwS95%2BVu%2BXW%2B-eMfq_vQ%40mail.gmail.com



pgsql-general by date:

Previous
From: Дмитрий Иванов
Date:
Subject: Re: The postgres server don't work
Next
From: Nicklas Avén
Date:
Subject: Re: Why not used standart SQL commands?