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 1txP9F-008dho-H8 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 11:42:17 +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 1txP9D-002GSw-Rb for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Mar 2025 11:42:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1txP6m-002Crz-TL for pgsql-hackers@lists.postgresql.org; Wed, 26 Mar 2025 11:39:45 +0000 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1txP6k-001Ht2-23 for pgsql-hackers@postgresql.org; Wed, 26 Mar 2025 11:39:44 +0000 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-391342fc0b5so5107409f8f.3 for ; Wed, 26 Mar 2025 04:39:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1742989180; x=1743593980; darn=postgresql.org; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:from:to:cc :subject:date:message-id:reply-to; bh=WHdv7v28zC9IZxE8JxO3qxsRK0c5BuRrYVdQdkj3tTk=; b=UDV/23Urj0jnRNjn7AoGH2TCMtWUgJH3JZhBMcB/BiKGW0xUIayl0pRVLjLRnlsrc3 CsMEZ5ru3RJg7+pIhBSBYDCCwy2wMiSi/luKQwFSxiROzvEd8uJfEoLIGgCpzN2ZnrjZ I7bL1pz9ywOq7ArjgD330rMQ/BypoOZSI55KV7eGWwA/mL7/hPAER3y2mAjBw1bxQNxB 0DDqR68DuY0aokEdN+XrGpsCxvrQX9SvI88RrKx1q4Pzo+lwqWck0RdBrs3gDvxHayT2 AtJ9dArFlnl3eFaLjeip1abDqnh7dKqOLXKE4rBTtxv/rkVlnZ5b3YQX70WA93w/CiYS fRxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742989180; x=1743593980; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WHdv7v28zC9IZxE8JxO3qxsRK0c5BuRrYVdQdkj3tTk=; b=WLRtRWVfbhtvI1bxURzRVcM+1EOOBU/E9ZcYSQOdhQ0CrW3LmS8ho16WpZVDoqjdR+ qasAOQp/39ieBbGo5+stfvrpBxpydC1+ZIUi3Y6GoAmQq9qOlcXDadOb9MaZ1qPfI1oM QT+MSWcVd7Fro+0VQilTHc68Og4coe8LC8O9yjbqNt+f89PDkbp2GyjwLIw3SJpsMQVG bQqeWQ34vt0Fp7RGqQ6WkkeaxGZRXy4hY+GYHTnDk0ykeo+P8+U+1WtNK3oz72ZCW0de qLKU1oIkCuVTfv+lHKLW4BLN6Avc0/M2ltdIsd42noG6yQXqTybfb2SxRHkDuU/9Lsv5 PHLw== X-Forwarded-Encrypted: i=1; AJvYcCVRSeHx3UqHQNUXlAzlG/Ve6B9BI1ivxyV4rxxpXUJLUf2ad0q9EWU+1Bxb/p8Nz+EvBvo0EX0w757TwalH@postgresql.org X-Gm-Message-State: AOJu0YxjvPki5dTiiXOzyhvy3G5OSi0TuXQL85Tepiu3jwZbbJW7ezLi NrziOBeYI1wWd2OD5xSDWtnm/SAtUx+ufz3y9BfsF/CJe6CwAKZarHN+1cRy2iI= X-Gm-Gg: ASbGnctvO72zy+dkRU5j1cGqRQa2hWDO2hSe8cYcDnohRBaEbKE67BzJiOTWq/FLTGu 5C6XfwpwnRoodXfnPgn2MfYgsuufQH1UZht4EuR6CON/UBI3Cf0PAVJ7IyYBpOUeXaGmxgy23C7 FlA0hA+HXWujNoPEU+TP58xNaqWJLFBPW3KWjitKSSd+1g32LGKA3+e6n6aJ6Smah1R20Y33AT6 zWXL5DjamLXRvqs97lDcQpwj0F+I1JRp6KXNZXHKn0o4HJyWP5glzJjvaBIG+w/9I0TuMEhLjY+ pO9lm2AKP/IQf2ni3mbKlt7ivdzS5LKbVs6mjBqD1Wm/c5k9A0ji3db5 X-Google-Smtp-Source: AGHT+IEMfALuZc14cXONsfvOG1meiSv2Pp0KGSNROkpoIsnGPJwi8e21l+Fo2OMw4n8TgOtJTb4Yow== X-Received: by 2002:a05:6000:400f:b0:390:eb6f:46bf with SMTP id ffacd0b85a97d-3997f8f88f9mr14794266f8f.5.1742989180151; Wed, 26 Mar 2025 04:39:40 -0700 (PDT) Received: from localhost (109-81-174-36.rct.o2.cz. [109.81.174.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f43ed6sm229144575e9.13.2025.03.26.04.39.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Mar 2025 04:39:39 -0700 (PDT) From: Antonin Houska To: Alvaro Herrera cc: Marcos Pegoraro , Michael Banck , Junwang Zhao , Kirill Reshke , Pavel Stehule , Michael Paquier , PostgreSQL Hackers Subject: Re: why there is not VACUUM FULL CONCURRENTLY? In-reply-to: <202503251432.o6obtgywjow5@alvherre.pgsql> References: <202503251432.o6obtgywjow5@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 25 Mar 2025 15:32:46 +0100." X-Mailer: MH-E 8.6+git; nmh 1.8; GNU Emacs 28.3 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <80296.1742989179.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Wed, 26 Mar 2025 12:39:39 +0100 Message-ID: <80297.1742989179@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera wrote: > On 2025-Mar-22, Antonin Houska wrote: > = > > Alvaro Herrera wrote: > > = > > > I rebased this patch series; here's v09. No substantive changes fro= m v08. > > > I made sure the tree still compiles after each commit. > = > I rebased again, fixing a compiler warning reported by CI and applying > pgindent to each individual patch. I'm slowly starting to become more > familiar with the whole of this new code. Thanks. > > > I did look at 0002 again [...], and ended up wondering why do we nee= d that > > > change in the first place. According to the comment where the progr= ess > > > restore function is called, it's because reorderbuffer.c uses a > > > subtransaction internally. But I went to look at reorderbuffer.c an= d > > > noticed that the subtransaction is only used "when using the SQL > > > function interface, because that creates a transaction already". So > > > maybe we should look into making REPACK use reorderbuffer without ha= ving > > > to open a transaction block. > > = > > Which part of reorderbuffer.c do you mean? ISTM that the use of subran= sactions > > is more extensive. At least ReorderBufferImmediateInvalidation() appea= rs to > > rely on it, which in turn is called by xact_decode(). > = > Ah, right, I was not looking hard enough. Something to keep in mind -- > though I'm still not convinced that it's best to achieve this by > introducng a mechanism to restore progress state. Maybe allowing a > transaction to abort without clobbering the progress state somehow (not > trivial to implement at present though, because of layers of functions > you need to traverse with such a flag; maybe have a global in xact.c > that you set by calling a function? Not sure -- might be worse.) The problem seems to be specific to the use of BeginInternalSubTransaction= (): if it is not called at given code paths, it means that there is no top-lev= el transaction. However REPACK CONCURRENTLY should always run in a transactio= n, so it should always run BeginInternalSubTransaction(). Thus I think we can= use this function to set the flag. > I also noticed that CI is complaining of a problem in Windows, which is > easily reproducible in non-Windows by defining EXEC_BACKEND. The > backtrace is this: > = > #0 0x000055d4fc24fe96 in hash_search (hashp=3D0x5606dc2a8c88, keyPtr=3D= 0x7ffeab341928, action=3DHASH_FIND, foundPtr=3D0x0) > at ../../../../../../../../../pgsql/source/master/src/backend/utils/= hash/dynahash.c:960 > 960 return hash_search_with_hash_value(hashp, > (gdb) bt > #0 0x000055d4fc24fe96 in hash_search (hashp=3D0x5606dc2a8c88, keyPtr=3D= 0x7ffeab341928, action=3DHASH_FIND, foundPtr=3D0x0) > at ../../../../../../../../../pgsql/source/master/src/backend/utils/= hash/dynahash.c:960 > #1 0x000055d4fbea0a46 in is_concurrent_repack_in_progress (relid=3D2197= 3) > at ../../../../../../../../pgsql/source/master/src/backend/commands/= cluster.c:2729 > #2 is_concurrent_repack_in_progress (relid=3Drelid@entry=3D2964) > at ../../../../../../../../pgsql/source/master/src/backend/commands/= cluster.c:2706 > #3 0x000055d4fc237a87 in RelationBuildDesc (targetRelId=3D2964, insertI= t=3DinsertIt@entry=3Dtrue) > at ../../../../../../../../../pgsql/source/master/src/backend/utils/= cache/relcache.c:1257 > #4 0x000055d4fc239456 in RelationIdGetRelation (relationId=3D, relationId@entry=3D2964) > at ../../../../../../../../../pgsql/source/master/src/backend/utils/= cache/relcache.c:2105 > = > = > So apparently we're trying to dereference a hash table which isn't > properly set up in the child process. I'll fix that. -- = Antonin Houska Web: https://www.cybertec-postgresql.com