Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcm56-001zli-3A for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2024 12:52:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rcm54-004aXf-4i for pgsql-bugs@arkaria.postgresql.org; Wed, 21 Feb 2024 12:52:10 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rcm53-004aXX-S3 for pgsql-bugs@lists.postgresql.org; Wed, 21 Feb 2024 12:52:10 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rcm4z-000GdM-SR for pgsql-bugs@lists.postgresql.org; Wed, 21 Feb 2024 12:52:08 +0000 Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-55f279dca99so772351a12.3 for ; Wed, 21 Feb 2024 04:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1708519925; x=1709124725; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=E2cor9Ul4Tc1kzXMy4CqXaJEMJv5J/uRVeN3XNuZAq8=; b=TB0oVm42100zKW33YiwfCzS7Bw9IxMGC1sKiCeJMFPEwqixazNV6+7X9Ix7EzV2n5H I+y92I2ZH4RGGZdTVuC3nxQ4PUcQIixVk8woBBNYGgZcGA0Z61KgH1KaITEnB9GG8OXl sYqCtgSJfRmoeFU1dJ/wXKlUO5zcBynRz1A2t6yNt1hPYGabPj9Puxz2kH6mRzoD1G63 kzxUyNFALRqE9fkYNsX9effLy4jTGJVrfmvDi6320MKtMj2uKxNYRrFjku0j7kdyg7/U u9rCFa85IB1O41kaDcMSTUQMxb6Jh6K1IWCQ/GbSNOlbgqBGnLS7eLHh7oW0RKLqwISw ejCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708519925; x=1709124725; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=E2cor9Ul4Tc1kzXMy4CqXaJEMJv5J/uRVeN3XNuZAq8=; b=ViIcZs1Vozhcd+ZcQOmSTZcwNnTsLCImx7ZQAW07XJfsffiu1yorHvuo0S/T1i+kH6 8hrQd9NbuexIItmFsLAIzi9MPxJE4u+HIvnXVgo8CtLFQF6v1Gbz7kyB4JDlfcxg67M+ rTT2cKaybeoFXRQPkyY2klb3WGkRSKr89F+FwKW1v2yshCWhDiNH7k/M766ETRnhtF7r F2zwgUgWwGdv3UEdmWK/bk05Q8QlKdb+mmkmIvstm5I7R6YoHfJMMyeAmV1SwatuodNl 0vEhBZ/M/SyC5EMjoo1Ku2UBXT8TtEfTQcoj3uA9MIMoqceN708MUfSdTqm83Nw1V3Wd lObg== X-Forwarded-Encrypted: i=1; AJvYcCW3zZ5SWnZY1vQO0xo/Zyz7c+c28FV6F41Xz83prAd3hOOqOqYR/mEulDXZZKXkx8s0Vk4E0GyLRBDV3k9ZGR84QumTB3JcI1jUn4ivDqAU X-Gm-Message-State: AOJu0Yzb6EsfwUPPSvlA7cSSJbz/bnLmI89St47bCWf/YOqjbyLjj0ve Pc5Hr4XROESRwsC58rAQjXVmD9FLSd8pPndk6ABlATTrOpd53/EGPagiaTVY7A== X-Google-Smtp-Source: AGHT+IHSRtqarU1bHoJUqYWHdRKY4j83Khngt5VCKFFBxqAjvn/qGDOdBUYCSLg0tIONBWCQ4D1fnQ== X-Received: by 2002:a17:906:1c5a:b0:a3e:9def:5ed5 with SMTP id l26-20020a1709061c5a00b00a3e9def5ed5mr5554143ejg.33.1708519925279; Wed, 21 Feb 2024 04:52:05 -0800 (PST) Received: from [10.137.0.18] (ip-86-49-229-30.bb.vodafone.cz. [86.49.229.30]) by smtp.gmail.com with ESMTPSA id vi10-20020a170907d40a00b00a3f0127419asm1509070ejc.80.2024.02.21.04.52.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 21 Feb 2024 04:52:04 -0800 (PST) Message-ID: Date: Wed, 21 Feb 2024 13:52:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: BUG #18349: ERROR: invalid DSA memory alloc request size 1811939328, CONTEXT: parallel worker Content-Language: en-US To: Alexey Ermakov , Andrei Lepikhov , pgsql-bugs@lists.postgresql.org References: <18349-83d33dd3d0c855c3@postgresql.org> <512ef568-336e-4087-ba23-f22b006d329d@postgrespro.ru> From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2/20/24 15:05, Alexey Ermakov wrote: > On 2024-02-16 20:40, Andrei Lepikhov wrote: >> Interesting. It correlates with one performance issue I have been >> trying to catch already 3 months. Could you provide some reproduction >> of that behavior? >> > Yes, I'm still trying to make reproducer, it will take some time. Thanks. > I wonder if this might be yet another manifestation of the hashjoin batch explosion issue we have. The plan has a hash join, and the fact that it runs with a bit more memory would be consistent too. The hashjoin batch explosion happens when we find a batch that's too large to fit into a work_mem, and increasing the number of batches does not really make it smaller (e.g. because there's a lot of rows with exactly the same key). We end up doubling the number of batches, but each batch needs a 8kB file buffer, so it's not hard to consume a lot of memory due to this. Chances are the DSA allocation fails simply because the system hits overcommit limit, or something like that. It's a bit weird it needs 1.8GB of memory, but perhaps that's also linked to the number of batches, somehow? Anyway, if you could set a breakpoint on the error, and see how many batches the hash join has, that'd be helpful. I'd probably try doing that with non-parallel query, it makes it easier to debug and it may even report the number of batches if it completes. regards -- Tomas Vondra EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company