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 1uY5JB-000u5D-Kg for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Jul 2025 16:00:09 +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 1uY5J9-007PMJ-OH for pgsql-hackers@arkaria.postgresql.org; Sat, 05 Jul 2025 16:00:08 +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 1uY5J9-007PMA-EV for pgsql-hackers@lists.postgresql.org; Sat, 05 Jul 2025 16:00:08 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uY5J7-005umi-2m for pgsql-hackers@postgresql.org; Sat, 05 Jul 2025 16:00:07 +0000 Received: by mail-lf1-x129.google.com with SMTP id 2adb3069b0e04-553b5165cf5so2432278e87.0 for ; Sat, 05 Jul 2025 09:00:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751731203; x=1752336003; darn=postgresql.org; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=tclF7Q5/YGytviHzoFrKwSP93QHUCptBHwqUooSAEHE=; b=enOcTwcurH12D2aWVhTPVp/ZiC8tcK/MaDUOWWsq4aLfbOvFaiZAYTmJkXPZOCNXl0 Rn9XkH3talrl342T7vZcNOqSRso0BV9GhamoJJ1y60l6h7Iq9RWzs7E6F3OtQqkZaGxg AxzObbQLE/2u0UaqZIy/SNelXy2tSGLj+zITg6oZ5U7IBESwN3Mm+3nqtHf7TP7nWfL4 kWec0/PQy99avgUWfUB7QKxBzmIuvUnTKwaHnee3atq06hwlVHr3Fnl76yh3Eu7NQL2F 9GGvqD8g36LJ/wJ8OTma2WNve2onH+TGA1vyelxAfvVQq97TZvznOeJlnHrZPu9FSDqW 7x1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751731203; x=1752336003; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tclF7Q5/YGytviHzoFrKwSP93QHUCptBHwqUooSAEHE=; b=NZxkNXP3iTKwIwxZgrhqJ9avD0j2T1vHfByqUjuHU5E84F/Cy4bBdqwzZzBAKQddyt AIJsFwDIUJjk0GpmH0CNpWNSsKUDEWUJq4bdU/ZkRjE/gb5Y4+wd3MPH9PNHty+DzmXa ysBc5NAv3O0LdSiF1qYKISl+TOSvh7TllMjPPnKWrcFQul2/60t7tk6XRQu6aDSC+hHt 0hCaKWIlGxCVZDqaKOZFVavjRstQ9d5BQXJISMvLoZGHzae5sIZbH/UF4nWZtLluR5Ki dHG00FZH0d3Jg6mGHa5gl/9YTkLLTiN7z6v/8W9WsTSCkF7uPQ5naWTgMSAcKyzt1BCk BS+g== X-Gm-Message-State: AOJu0Yw4nXUSFrF1xrs1Y9e8c/oieV+f6hDrWElgFQabkClhlyyuSQGN bQNOKyPChxekmnZra6o7ihlZDiNcChyDbirgePFKCMzgBKY65JLxprzXuhh4efnL X-Gm-Gg: ASbGncvq+lQbZK1IXUdaFPrOIcFyQxT+E2235+vxrXCnKMJp/Hz9+UgV4OZr0CI12ws LMEV/MHr204Xq7NTvt4YnjLVGivc7BPgtyvW04U8/33AyZVL1N2mP1aAiBJJEFr/WgTLncTQ8cx 0VIscgfCkEwMt4zptYc+uIpYSCdaiImelJOOdd02UYGm7jrNQjGbfxhN52GlDDrkOYU4sk00pt4 JzUX6T4oJDLFwJk4gGmrXS1w/oDK88G6R+69qQakj3nn8j/NE/sqZNmsqyBPszLpJd+ZXkHpLU2 M6ht3ZksHO94y1Thy4OYH85YXztm6m+lr6SDwH9TJBow1S5/2jFgW9wZzK8dLP3V X-Google-Smtp-Source: AGHT+IF5E/jgUAb/DkWJuVIkXCeO0i2ickKv8jsf/L9E27ByUV4+HHKFiK3gztQDz7BtRa+cGF8C9Q== X-Received: by 2002:a05:6512:250f:b0:553:af02:78d3 with SMTP id 2adb3069b0e04-557e555731emr590080e87.25.1751731202451; Sat, 05 Jul 2025 09:00:02 -0700 (PDT) Received: from [192.168.0.50] ([89.149.68.212]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-556384a80a7sm627423e87.152.2025.07.05.09.00.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Jul 2025 09:00:01 -0700 (PDT) Message-ID: Date: Sat, 5 Jul 2025 19:00:00 +0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: pgsql-hackers From: Alexander Lakhin Subject: 024_add_drop_pub.pl might fail due to deadlock Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello hackers, The recent buildfarm failure [1] on REL_15_STABLE with the following diagnostics: # Looks like your test exited with 29 just after 1. t/024_add_drop_pub.pl .............. Dubious, test returned 29 (wstat 7424, 0x1d00) pgsql.build/src/test/subscription/tmp_check/log/regress_log_024_add_drop_pub [21:01:34.406](16.501s) ok 1 - check initial data is copied to subscriber error running SQL: 'psql::1: ERROR:  deadlock detected DETAIL:  Process 219632 waits for ExclusiveLock on relation 6000 of database 0; blocked by process 218369. Process 218369 waits for AccessShareLock on object 16387 of class 6100 of database 0; blocked by process 219632. HINT:  See server log for query details.' while running 'psql -XAtq -d port=14957 host=/home/bf/bf-build/petalura/tmp/bGI6HuRtfa dbname='postgres' -f - -v ON_ERROR_STOP=1' with sql 'ALTER SUBSCRIPTION tap_sub DROP PUBLICATION tap_pub_1' at /home/bf/bf-build/petalura/REL_15_STABLE/pgsql.build/../pgsql/src/test/perl/PostgreSQL/Test/Cluster.pm line 1951. pgsql.build/src/test/subscription/tmp_check/log/024_add_drop_pub_subscriber.log 2025-07-01 21:01:32.682 CEST [218369][logical replication worker][3/6:0] LOG:  logical replication apply worker for subscription "tap_sub" has started ... 2025-07-01 21:01:34.771 CEST [219632][client backend][4/14:0] LOG: statement: ALTER SUBSCRIPTION tap_sub DROP PUBLICATION tap_pub_1 2025-07-01 21:01:37.355 CEST [219632][client backend][4/14:731] ERROR:  deadlock detected 2025-07-01 21:01:37.355 CEST [219632][client backend][4/14:731] DETAIL:  Process 219632 waits for ExclusiveLock on relation 6000 of database 0; blocked by process 218369.     Process 218369 waits for AccessShareLock on object 16387 of class 6100 of database 0; blocked by process 219632.     Process 219632: ALTER SUBSCRIPTION tap_sub DROP PUBLICATION tap_pub_1     Process 218369: 2025-07-01 21:01:37.355 CEST [219632][client backend][4/14:731] HINT:  See server log for query details. 2025-07-01 21:01:37.355 CEST [219632][client backend][4/14:731] STATEMENT:  ALTER SUBSCRIPTION tap_sub DROP PUBLICATION tap_pub_1 shows that the test can fail due to deadlock on accessing pg_replication_origin (relation 6000). This failure can be easily reproduced with: --- a/src/backend/replication/logical/origin.c +++ b/src/backend/replication/logical/origin.c @@ -428,6 +428,7 @@ replorigin_drop_by_name(const char *name, bool missing_ok, bool nowait)          * the specific origin and then re-check if the origin still exists.          */         rel = table_open(ReplicationOriginRelationId, ExclusiveLock); +pg_usleep(300000); Not reproduced on REL_16_STABLE (since f6c5edb8a), nor in v14- (because 024_add_drop_pub.pl was added in v15). [1] https://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=petalura&dt=2025-07-01%2018%3A00%3A58 Best regards, Alexander