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 1upEUh-001NMj-4c for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Aug 2025 23:14:56 +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 1upEUg-001oxv-6D for pgsql-hackers@arkaria.postgresql.org; Thu, 21 Aug 2025 23:14:54 +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 1upEUf-001oxn-OV for pgsql-hackers@lists.postgresql.org; Thu, 21 Aug 2025 23:14:54 +0000 Received: from mail-pf1-x431.google.com ([2607:f8b0:4864:20::431]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1upEUd-0015po-2V for pgsql-hackers@postgresql.org; Thu, 21 Aug 2025 23:14:53 +0000 Received: by mail-pf1-x431.google.com with SMTP id d2e1a72fcca58-7702fc617e9so289002b3a.1 for ; Thu, 21 Aug 2025 16:14:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1755818091; x=1756422891; darn=postgresql.org; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VU+tB+dtiVTIb4viWyw16pobRS80P/VZlIEEEftOtL0=; b=blzc2awSzHaZaHPhnFQrAcnD8nAlOkBGuCaZropbYhGk5XfIa+rGgBNBoKPGbK46Xc EAox5ygoleg8++/iBiEC5bKZw/0LU2pb5eXhiHrKO5x3k4MY3mXnhV4ZYJBJdmJB0jXl M3VmtZFgzCATFsHMI9IPBbO9jMQEARccqCrv8OMpl0/u6xHAsktkUIe34jeQgFYjS7aw iCUocqxB+dvQklX66Vh2UBMwY5RkgFZtPQeh3E2np3ADUaEFIBNDc94CYomBfO+xBP7R kq/EcfjcjjVUFCneSjl1ym5grJguR8t5+jIMjeFqLpMkfAQhx15Nrnlru+9H85g7OF31 F6Dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1755818091; x=1756422891; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=VU+tB+dtiVTIb4viWyw16pobRS80P/VZlIEEEftOtL0=; b=Vhxik296XQ27bhXVTBI/GTMbLRoh6yUSq+HLpM4OdyL7It8JvZtooCgmNMXziXKu5N EWhF/qw4951HHEwMNeJZZiTrvFVVh13brGK3dd47QSPoUnD8eYtmh5W1wZUJBMBDBGSG zyHproTeYff+rSnHIGwDwx5EH/VDXeTRBa9+v+KZV0DWER5Jtw5BSWetrxbvKrKkaClG R/8WcG/0rGR7yqt+XZ9L+o1gM451PzwllXXADHg4dy+97NJQ5l0Eme1h5DXK55JPtDWc LqqITgIXbJF+EeC/cuikBuLuYAV0EGQ+vy4RXxpr7Nl8/0dd+B2Loyt0lvqwtvoCFyto 6nkg== X-Forwarded-Encrypted: i=1; AJvYcCVNjKbUpJnRvSv1YHcg8IjzcuDvrbV5/qgg7PxdpdKfOhR/o8TAIOiag5VFla2Tqz1NhzPFSW/FLeG6LUhI@postgresql.org X-Gm-Message-State: AOJu0YxthGDrO3vD9/OuqnTz9GPnxYdkEqhs4pFu4M5M1ll67pVPEcN3 NPrbi3j89gApGumnddSTUmF+ZChGB0gn5l49IQcWzGHlJAZsGSVnzRBY X-Gm-Gg: ASbGncsMfQNcvZPIdzmnRT1J+b1Y0hYz+hS5XUoHB78hKKWvXrFjmlvQXDw0OILyBvQ U52DVAZUOpJzlglP1XudzNZ0NK7nPE4QggztYv+dWLvLaAPN1fp8jzgnUG7arqkBITb3fG2eaSl GICaE8RrFxUvDURX+9TceIyzdbFa34XG/c0JuntOr1vsz6zuFQt8HsLYkr9QyQVrecTQPwlPdqj 8TpK3NuNT+MEmBEm3Z3cJlTZlRoE1MVVBtCOD5MEd2VKIRrrUD+cFLDfrmaXXtLMizgp3KfFPeJ txNcFzu1vJjhKachbMiDKbreFbfkop/vm3MX9SzesDW9r9LARbG8qvgiWyBcEX8U4UmiY9w4Ek/ 6hzWYCg6XTK0k84vP+s1J9kSkNFi36TZfT09OKgAE1RM2nNz8E64= X-Google-Smtp-Source: AGHT+IFQLqFollaf0SpNMHQbYtL0QMsTMg9ewKo9TNO+3uhkilkKliYDA1jKS3HpmZ7G0vz2zNFonA== X-Received: by 2002:a05:6a21:6d86:b0:240:2320:abb8 with SMTP id adf61e73a8af0-24340d41e97mr1225729637.41.1755818091327; Thu, 21 Aug 2025 16:14:51 -0700 (PDT) Received: from localhost ([2804:14d:328a:a59c:24c8:70ba:5443:473f]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-325123e457fsm795821a91.2.2025.08.21.16.14.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Aug 2025 16:14:50 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Thu, 21 Aug 2025 20:14:47 -0300 Message-Id: Subject: Re: LISTEN/NOTIFY bug: VACUUM sets frozenxid past a xid in async queue From: "Matheus Alcantara" To: "Masahiko Sawada" Cc: "Daniil Davydov" <3danissimo@gmail.com>, =?utf-8?q?=C3=81lvaro_Herrera?= , "Alexandra Wang" , "PostgreSQL Hackers" X-Mailer: aerc 0.20.1 References: <202508061044.ptcyt7aqsaaa@alvherre.pgsql> In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu Aug 21, 2025 at 7:25 PM -03, Masahiko Sawada wrote: > What about backend processes that don't have any xid or xmin (i.e., > are read-only query and in idle-in-transaction)? > > IIUC we process the notification entries at the beginning of the > server loop (see L4608 in postgres.c) and when reading a command (via > ProcessClientReadInterrupt()), but it seems to me that if a process is > in idle-in-transaction state it doesn't process the entries unless the > transaction is committed. I've reproduced the missing clog entry error > even if we have a notification on the queue with a valid listener, > with the following steps: > Ok, now we can reproduce this, thank you! So I think that we need a way to teach the VACUUM FREEZE about old xid's on async queue. I'll work on this considering the initial Daniil comments at [1] [1] https://www.postgresql.org/message-id/CAJDiXgg1ArRB1-6wLtXfVVnQ38P9Y%2B= CDfEc9M2TXiOf_4kfBMg%40mail.gmail.com -- Matheus Alcantara