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 1vW37C-00BaLr-2G for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Dec 2025 01:47:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vW37B-00HUX3-0q for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Dec 2025 01:47:38 +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 1vW37A-00HUWv-36 for pgsql-hackers@lists.postgresql.org; Thu, 18 Dec 2025 01:47:37 +0000 Received: from mail-lf1-x12f.google.com ([2a00:1450:4864:20::12f]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1vW37A-001FQP-15 for pgsql-hackers@lists.postgresql.org; Thu, 18 Dec 2025 01:47:36 +0000 Received: by mail-lf1-x12f.google.com with SMTP id 2adb3069b0e04-5942bac322dso136237e87.0 for ; Wed, 17 Dec 2025 17:47:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1766022453; x=1766627253; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=k/u17YgJ0tDa8ADbo5SfFl1olD3iTC6H1m7/ra6j3z0=; b=ERBGpjaMdFDksZkRjgVrv96JRAkkRE87+6C2hnmFSNxjoVZfec+EnydZPy07SOJEeX ZDeFt99hlMNjWV+qrqQwkP5fqehHs9ao3oJA1o4++ZYpHoXS4I+gjSoyWKOunOtasSwP Kgl91Sp09pmcTOcFTipeXv4GcqOa4X+bWKee8m2hcC34nf5YD2SZIwnBL8IAm57OK/i/ xU/rHp1rLW8iTGEHpsIZR0dlVfsZAs9lUyqVB9qEbypW52QXv0+77WIFu1I7PUsH10ES T+/lSCFf5UV9X+MQme1J4VNCNfjSdmoa3IxN8KdMium7VquULbZhjLUFkK/7tQVkQSZm 8wvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766022453; x=1766627253; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=k/u17YgJ0tDa8ADbo5SfFl1olD3iTC6H1m7/ra6j3z0=; b=gm0vTkhqVX8sH4svpn1Gy6GA/9tz3qX/+I4MloWmIj9MTRnjJDuzLxnTJBmpiriwoM 2jVhhFeTGnvPPPeDtROd7mA0qke91iw2L2pf2xyuEcQgHgdLXMg9NhOw3+sUBjohDqmK NdTx9Hni+GUPPtvvlao0sGjbq8QuMQ/wGoI9EIaeDtnYbbVo+ddt1oonebBwPdUu+Pd3 Ue9qmwJ/0UdcAEnq0FMdzxHHJcBQnptLD3YoDP3QTjHC/OusuFSat876YNqMfGGUE/TH c7G6mP7iEKO8i49QPUiB6iolGGCBswdRzwEKe870FzCALNj8lHe5fgbyX325ufsTa+1a WCug== X-Forwarded-Encrypted: i=1; AJvYcCXfOW4urpdmvdP7neYgHpXQHAv0GqBKS1hYLIlR5licNcN8l8fbWhe5D9yv5dzDRzNdBlxCGrkY945HGNmo@lists.postgresql.org X-Gm-Message-State: AOJu0Yyo4prr/1J9HQ1yNIpFLf8lxFVylefJxVd9ojb15L6ZPWI88+Yb 2XNO+bIoICjKmZF2HKO7Mfs5ocNK7hx2AqhuV3DObcgFpanRuFamc5rptKgQAWYwxLErMDkRtFg QgIemewB+Xb8YG75yIAPa/A7d5HQruG0= X-Gm-Gg: AY/fxX545ZE+1dWfSFfpjFUuvyckUYqx6ZBybUbsvcmygjPXB5OebMtk3k6Rq4iMk/8 15LCmfeke55euOUP1iGwEHIbl5Kv+4Y6ymaPES+fjBx2qIYOR3IAMP4pqWzBdHshscfSxrOmiS4 CKF2AgPANS8AFZLd2syXb4uBk6hDRuoPe5V7phhI68xr67ek6JAG5uCt2lRx/BWLwSSDxZlwYY+ h8jhC5/3KFXXDl5ilma/YwVEbTwEZtlFLmYKpJxdsQ/+psVdYxxiKcV5rTVKWXmVAXl14E= X-Google-Smtp-Source: AGHT+IEtg6gNkjDtf2ylxlvXm6DeDdlcspoJhu3HRShlqAIb9SCoq+XFsdJYJ/vwcNfFiiBckVgtVfuVjneW7fPvWCg= X-Received: by 2002:a05:6512:118a:b0:595:910c:8eeb with SMTP id 2adb3069b0e04-598faa5cb96mr5454472e87.37.1766022452692; Wed, 17 Dec 2025 17:47:32 -0800 (PST) MIME-Version: 1.0 References: <202510301734.pj4uds3mqxx4@alvherre.pgsql> <116433.1764870207@localhost> <171530.1765306357@localhost> In-Reply-To: From: Mihail Nikalayeu Date: Thu, 18 Dec 2025 02:47:00 +0100 X-Gm-Features: AQt7F2qOvtp4VyhGdC19qfdkX1w1KqWPj53RXI_rzldl_BKTU4_LG25x-4nEMgc Message-ID: Subject: Re: Adding REPACK [concurrently] To: Antonin Houska Cc: Alvaro Herrera , Pg Hackers , Robert Treat Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello! On Sat, Dec 13, 2025 at 7:45=E2=80=AFPM Mihail Nikalayeu wrote: > Stress tests for REPACK concurrently in attachment. To run: ninja && meson test --suite setup && meson test --print-errorlogs --suite amcheck *007* ninja && meson test --suite setup && meson test --print-errorlogs --suite amcheck *008* Results for v28: Up to " v28-0005-Use-background-worker-to-do-logical-decoding.patch": Technically it passes, but sometimes I saw 0% CPU usage for long periods with such stacks (looks like it happens for 0008 more often): epoll_wait 0x000078b99512a037 WaitEventSetWaitBlock waiteventset.c:1192 WaitEventSetWait waiteventset.c:1140 WaitLatch latch.c:196 decode_concurrent_changes cluster.c:2702 repack_worker_internal cluster.c:3777 RepackWorkerMain cluster.c:3725 BackgroundWorkerMain bgworker.c:850 postmaster_child_launch launch_backend.c:268 StartBackgroundWorker postmaster.c:4168 maybe_start_bgworkers postmaster.c:4334 LaunchMissingBackgroundProcesses postmaster.c:3408 ServerLoop postmaster.c:1728 PostmasterMain postmaster.c:1403 main main.c:231 epoll_wait 0x000078b99512a037 WaitEventSetWaitBlock waiteventset.c:1192 WaitEventSetWait waiteventset.c:1140 WaitLatch latch.c:196 ConditionVariableTimedSleep condition_variable.c:165 ConditionVariableSleep condition_variable.c:100 process_concurrent_changes cluster.c:3042 rebuild_relation_finish_concurrent cluster.c:3303 rebuild_relation cluster.c:1121 cluster_rel cluster.c:731 process_single_relation cluster.c:2405 ExecRepack cluster.c:391 standard_ProcessUtility utility.c:864 ProcessUtility utility.c:525 PortalRunUtility pquery.c:1148 PortalRunMulti pquery.c:1306 PortalRun pquery.c:783 exec_simple_query postgres.c:1280 PostgresMain postgres.c:4779 BackendMain backend_startup.c:124 postmaster_child_launch launch_backend.c:268 BackendStartup postmaster.c:3598 ServerLoop postmaster.c:1713 PostmasterMain postmaster.c:1403 main main.c:231 Probably it is because > 100000L, /* XXX Tune the delay. */ 100 seconds is clearly too much. For "v28-0006-Use-multiple-snapshots-to-copy-the-data.patch": 0007: crash with TRAP: failed Assert("portal->portalSnapshot =3D=3D GetActiveSnapshot()"), File: "../src/backend/tcop/pquery.c", Line: 1169, PID: 178414 postgres: CIC_test: nkey postgres [local] REPACK(ExceptionalCondition+0xbe)[0x5743f9a955bb] postgres: CIC_test: nkey postgres [local] REPACK(+0x67fac4)[0x5743f98a7ac4] postgres: CIC_test: nkey postgres [local] REPACK(+0x67fced)[0x5743f98a7ced] postgres: CIC_test: nkey postgres [local] REPACK(PortalRun+0x346)[0x5743f98a7107] postgres: CIC_test: nkey postgres [local] REPACK(+0x6773bb)[0x5743f989f3bb] postgres: CIC_test: nkey postgres [local] REPACK(PostgresMain+0xc1c)[0x5743f98a4f58] postgres: CIC_test: nkey postgres [local] REPACK(+0x6726c6)[0x5743f989a6c6] postgres: CIC_test: nkey postgres [local] REPACK(postmaster_child_launch+0x191)[0x5743f979678c] postgres: CIC_test: nkey postgres [local] REPACK(+0x5755ca)[0x5743f979d5ca] postgres: CIC_test: nkey postgres [local] REPACK(+0x572972)[0x5743f979a972] postgres: CIC_test: nkey postgres [local] REPACK(PostmasterMain+0x168a)[0x5743f979a225] postgres: CIC_test: nkey postgres [local] REPACK(main+0x3a1)[0x5743f9662176= ] /lib/x86_64-linux-gnu/libc.so.6(+0x2a1ca)[0x77f80402a1ca] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x8b)[0x77f80402a28b] postgres: CIC_test: nkey postgres [local] REPACK(_start+0x25)[0x5743f9311eb= 5] 0008: pass Best regards, Mikhail.