Re: create database hangs forever on WSL - autovacuum deadlock?

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Alicja Kucharczyk <zaledwie10minut(at)gmail(dot)com>
Cc: "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: create database hangs forever on WSL - autovacuum deadlock?
Date: 2022-01-09 20:55:02
Message-ID: CA+hUKG+7S+2wOi9fqdMT9cpDct7v9K86u+0OTDg23KTvt_YfJA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 9, 2022 at 2:15 PM Alicja Kucharczyk
<zaledwie10minut(at)gmail(dot)com> wrote:
> sob., 8 sty 2022 o 22:40 Thomas Munro <thomas(dot)munro(at)gmail(dot)com> napisał(a):
>> On Sat, Jan 8, 2022 at 8:11 PM Alicja Kucharczyk
>> <zaledwie10minut(at)gmail(dot)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, compiled by 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Nicklas Avén 2022-01-10 07:47:02 Re: Why not used standart SQL commands?
Previous Message Дмитрий Иванов 2022-01-09 13:47:54 Re: The postgres server don't work