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.96) (envelope-from ) id 1vgoOs-004NXi-0K for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jan 2026 18:18:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vgoOr-004dfI-0r for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jan 2026 18:18:21 +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.96) (envelope-from ) id 1vgoOq-004df7-30 for pgsql-hackers@lists.postgresql.org; Fri, 16 Jan 2026 18:18:21 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vgoOo-000nf2-2Q for pgsql-hackers@lists.postgresql.org; Fri, 16 Jan 2026 18:18:20 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-47d1d8a49f5so14620355e9.3 for ; Fri, 16 Jan 2026 10:18:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1768587498; x=1769192298; darn=lists.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=hMJxi/90/WuO1g3bMbmRNIgSwApXLo3QU/nzmcEYn0M=; b=g7y+ClgL7f9+Jrpz4MvUAjzu1dX/jfI5rYoZWFMAJfO+lofXFV6+41sr7mFvEosWxZ perXfQdbhz+F8avEpkqJ+hYnTg7Nzs8mCme2lF3Vb3KzofFTsZzXuZL2j+Vd2JWJOoPb dO56tgsvngAjhiB4FwxWIz6AWmwBZmObnDpcffaUUkfVmZtfgMWtRRNBAuY2zH+0ewHx slpMTGSs31lt3ZDHdUcjwvc2wdORnNXJl8Puj0pSbGf5nMkdBJFsij+0tnvzEu+Q2iDO xROfsikd0kfeH5KXEMRp56ks6zO6ABqxpjzlv9Qb7gjFnDNeJiw9R7HENAKiNq3Ag59Z 7gLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768587498; x=1769192298; h=message-id:date:content-transfer-encoding:content-id:mime-version :comments:references:in-reply-to:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=hMJxi/90/WuO1g3bMbmRNIgSwApXLo3QU/nzmcEYn0M=; b=v8r7/wOP5wo1sRKuUsIzbKDQ3ruZ5dIhGGCzTxZZ3mFZDP5fReUwOvcRmK38pWT3aA vN+XuPJZ6ZCPH5pKXvuN/UjR5hb/PNAhoLMV9yksGuVDOGJJLgM+FB4Hxhqak/M1TIx/ +WH1oeGZo0a5LlVwW9y1XS/QbTMZt8rMpSfXchFq1YSNhLuwiHiBsVcQ6DH81FwYVNAQ w9U4wzZU+9UKKqjatCk06aP6pUxm/BXtO+3clksUaK5vqV6GyBK3HV0BqHl6MV/+zA6u igvTjBavK1rq11DI5ht/I08wKPqHJXKiUCnMnCCUO1bWKDtgxEA0HofIccgRBi6tNALe QYug== X-Forwarded-Encrypted: i=1; AJvYcCWIVugPLboMsaXnM1uSkX7ycT2t6Cwb0DaoE3cMmO2xjqm22JvEygAxFN+rRjRcgxVDYwqhmbrJ9l4MmAqQ@lists.postgresql.org X-Gm-Message-State: AOJu0YxjIlFu2viaPNu/lYX80+/5M7bwAQ3uSA+f/fUcp+6zDr3CF985 htjWs+Wagy6YlEdoXG6PRnLpIFRwLE7JMRNt/mcTr26qBpWOwDGREMjJG4xMLRIfAIg= X-Gm-Gg: AY/fxX53tImiA5ViHMSdTQQ+q9wvLfq/2CglgSMlGtchQ7M9ePaB+EgaVoCv0QKn1wR nN1NjIAW+8ftbYnE9VbqEm17MNXD1SsRwpmfOAdkbINBLhMQp+cXX0Qts6S0xlZAYkMd0NSDkji SFrNCfmHeuSrRXhAbXhXNcNHfzXwiNCo7zf8sFo7TQyTby+lXyiVpOHz5s7QTTvCQvoojV2We5j 93R16upW09Oreq7p8SF/XFbRWz3+IA+ANYHwuq83QGOUuAe//xHVnsbcTaO7nlitUr0KnXeeRs2 jt6WSd+usw3Y5/wajo312f8u9Y9f+0UKz+VQle4CBSGivoIhG/y+uTRoc3vmIfFfxTMR+qL1iMn uqva8/o5bAIAbHf0YpABjuf8hoXMzdZVOFNJ8NVYjw/H92ynXm1qpJEZGfD3uDg4XQdgeG73zBZ Py6FczQVP3B2BQZ4YHvonfpZ3H X-Received: by 2002:a05:600d:8445:10b0:480:1a22:fce8 with SMTP id 5b1f17b1804b1-4801e3494acmr39620825e9.26.1768587497808; Fri, 16 Jan 2026 10:18:17 -0800 (PST) Received: from localhost (109-81-168-246.rct.o2.cz. [109.81.168.246]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4356996dad0sm6461334f8f.27.2026.01.16.10.18.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Jan 2026 10:18:17 -0800 (PST) From: Antonin Houska To: Mihail Nikalayeu cc: Alvaro Herrera , Pg Hackers , Robert Treat Subject: Re: Adding REPACK [concurrently] In-reply-to: References: <202512151349.vlq3mpfniyk3@alvherre.pgsql> <11247.1767609087@localhost> <11558.1767609632@localhost> <141054.1767891540@localhost> <137668.1768235610@localhost> <35686.1768495019@localhost> Comments: In-reply-to Mihail Nikalayeu message dated "Thu, 15 Jan 2026 20:05:02 +0300." 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: <23346.1768587496.1@localhost> Content-Transfer-Encoding: quoted-printable Date: Fri, 16 Jan 2026 19:18:16 +0100 Message-ID: <23347.1768587496@localhost> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mihail Nikalayeu wrote: >Antonin Houska : >> = >> As the test runs pgbench with --client=3D30 and the default value of >> max_worker_processes is 8, I'm not sure this is a leak. I've increased = this >> parameter I couldn't see the error anymore. > = > Hm, as far as I remember only single repack may be executed in test (bec= ause > of locking on test itself and also REPACK). The only problem is that the logical decoding system needs to wait during = the setup for all the running transactions to finish. So if REPACK (CONCURRENT= LY) is already running, the next execution will not start until the first is d= one. However, that does not restrict the REPACK decoding workers from starting. >> I agree that this is due to the missing MVCC safety feature. I comment= ed that >> check in the script for now. > = > I don't think so. In case of non-MVCC safety we should see 0 or correct = sum. But script failed with 490588... > But should see 500500 (if I correctly calculated sum of numbers from 1 t= o 1000)... I was referring to your statement "It may be 0 because non-MVCC safe". Regarding the non-zero values, I think I finally understand the iss= ue and even could reproduce some weird behavior using debugger. Since it also affects logical replication, I'll provide more details (and hopefully prop= ose a patch) in a separate thread early next week. In short, it looks like (hopefully very) rare race condition, such that th= e snapshot builder can build the initial snapshot before all the commits hav= e been recorded in CLOG. When that happens, visibility checks don't work correctly. -- = Antonin Houska Web: https://www.cybertec-postgresql.com