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 1wUY9J-001FDe-0t for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2026 23:03:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wUY9G-00GKSj-2f for pgsql-bugs@arkaria.postgresql.org; Tue, 02 Jun 2026 23:03:50 +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 1wUY9G-00GKSb-1O for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2026 23:03:50 +0000 Received: from mail-yx1-xb12c.google.com ([2607:f8b0:4864:20::b12c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wUY9E-00000000orm-09Wv for pgsql-bugs@lists.postgresql.org; Tue, 02 Jun 2026 23:03:49 +0000 Received: by mail-yx1-xb12c.google.com with SMTP id 956f58d0204a3-66061993121so3956326d50.0 for ; Tue, 02 Jun 2026 16:03:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780441427; cv=none; d=google.com; s=arc-20240605; b=kfIewVe8c8PwS42hFh7U1NH9Xxl0FvwWN5UYswCEUFvNDG3m+0nBBhRw3D74ISChzQ us9HGdnzWszkdSlx5S1ERHMWfs0AlUcKvYe8BQbEs/5l1BkxyhvWqw45sUuWYRLNd0VH 9/8GsQUj64HnK04RQCpoouQS87yEj4UXvQ3CcLJDi8gBlkxoFw/LOnHmq+KW5NwSxXKx pH9pLaM7btM13M0W4jlpB1xb71fuaCTsO1R3Uh5qrUj2tySrUT8luCzZ5zxm/rQHA10b QZtDNymsihwGr6uWCRQoFarYiX4+o+noNIdMcPNVH5nct9qF+SZxWd1Ire6I0Jeiu+8h nt1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :dkim-signature; bh=nSEmjHSGCMdxmCWYcEpPofnvxIKsfCglrMfn9CF3Ylc=; fh=/gQe77b11iMZdcPj/nJr/Ghqi6rQp5FPrPbdO93bmOA=; b=VmavWB5OruGxuNM16WlydZ+mhe1K8r4EyXSP/Bhrs8+rf0iyjI2vo9Ma/E/XC8OcNN K7rd77iMR5WJJ4p3xQdPxTzfMByfaoGpAyuuCCbmW3fSCaacfC+A2buAllEPgly9xjKP xl7QxWVg8mlRRNEu8EBx4rk3yTz5EsSaOJzaA9vw34IQi4i2n5vETMbCLlXu2iVACIWJ L8bjLvhuGuUO0+SxFHHkqyfHkgnmRA05VegAxtuO1f/xrv92yioT/aEQKrAwVczxRU3Z vIeLXa2njO++g75dLyt/MKXDabJJjOeE5OrTQFU235ve+wMyamI5sK9efLEu3XZ9LC8s E7Hg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=percona.com; s=google; t=1780441427; x=1781046227; darn=lists.postgresql.org; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :from:to:cc:subject:date:message-id:reply-to; bh=nSEmjHSGCMdxmCWYcEpPofnvxIKsfCglrMfn9CF3Ylc=; b=Oh2O746Q4iEiNWoSwzH0N2EOzp1RkDbxIdW42SVg4tcrdmNu20jO4re35S8rVd9agv yevjvIKSqeguHxseuIyFsbtY2nHPbgmPvi0yTvZ9xC3tJ1DI9GrEjdV3c0jEqUxXNHlF vRyx8gLRTK4FJUgl+ZZQSR7zqT91dzkhf6C/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780441427; x=1781046227; h=to:subject:message-id:date:mime-version:references:in-reply-to:from :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nSEmjHSGCMdxmCWYcEpPofnvxIKsfCglrMfn9CF3Ylc=; b=mWt2u+8iEDbvcdV/mU1+XVDBQct0or0kBZZx4TbVDgyi3F9YPkqt5Orrruz22Yz8lk fsoaPIknfn84LnKxzi2X+y1YEgOuyCuRDORowCm8EXw3dh5MHr41Wzk3GFN0ovofgRsw YbaEK9iGsYWVyTfU5GMXwloAFYvnvKMgoTXnJtA9IXnVOLrZegknxvvEUoVmgzJVg1Dr 7DcGP8NFqb3vnm60OovVcaDyM0oaNp5sXUWwNcOpyhJNeT6Ft+ka4iJ+n6Ia9O9QNl0X 7Gn0HHZoZa/9r3gdbXPR0AlyAweSzE+f9LqvB7yEGeqrNpSlbpd76gXLbgljRBZVHZY9 M+Sw== X-Gm-Message-State: AOJu0YzDlyhfS4Gxs1lTw51h0XT06KAyVvNnyhFM2rr6njHlTrDfdw/o +IqAvIaNAARYIJX6Erwd1IrP1hPmouPvbozLLhFSBY7A17a42bQ0ccEMWDg5gxtuz+esAdL6nbz 483zm3Y5W/GqWLVAwdFPa6P++p2jZGvGRkDP+ESLx1B2Om+kBebCdudBk/jOu1Uys8hcMeNN+LX JakQAKzMLXk1kfXGcdnZEN9blvGtiUAjbBqyQ7geeKMKtISd5mb7qQigdRDZFLGyOC8tyTbLWBT eEMrifT8/SrAvVZih4AIS3blbQwjPoZr8vtzkDmFfwYgrqSbXC+FQQ91OaqcjyV70ITNA== X-Gm-Gg: Acq92OFUdsFdm2QoM57hwLXQVhjyFJBJDdm+PtHd4gYmGpSqpCJ8Yt2DXhXKvr/OFSo obuMQPyEY0lShBuqbVenaOIgVE/yLq3WgKcjbA+RZs1BxfqEuCPqe2cOm9mE6Gga9wpOdGkP8ku xvwIwp4KG/usj5zIRHRLsk8RsE3XmAJLug6f7VOhfVUN1spEVo9VIszN+PZCDfgWoZEIAwUIu2N ubhJouVtO+pFy1kNPexWPGIxCjE2nLiDdu3NJOhon95T4G55/4Cl1NGJz/wmQ4BSvxt9HM38tdv NbWMFDts2Cfr5bRauRbd2VQVHU2T0ENFRCBP/tUKrYiN6DLu2IJEkIct3yU2sfucZfZmtFpE6Gg tDxU= X-Received: by 2002:a05:690e:484f:b0:660:5d71:7b46 with SMTP id 956f58d0204a3-660dbe634bfmr553853d50.12.1780441426875; Tue, 02 Jun 2026 16:03:46 -0700 (PDT) Received: from 298783833264 named unknown by gmailapi.google.com with HTTPREST; Tue, 2 Jun 2026 16:03:46 -0700 Received: from 298783833264 named unknown by gmailapi.google.com with HTTPREST; Tue, 2 Jun 2026 16:03:46 -0700 From: Zsolt Parragi In-Reply-To: <92417390-9753-4F6D-AE30-DA10FFF2A4DA@yandex-team.ru> References: <165342c0-0c75-461e-b334-b997639ad48d@aphyr.com> <1F2F4318-437C-4AE1-8413-F94FBDD5AB68@yandex-team.ru> <92417390-9753-4F6D-AE30-DA10FFF2A4DA@yandex-team.ru> MIME-Version: 1.0 Date: Tue, 2 Jun 2026 16:03:46 -0700 X-Gm-Features: AVHnY4JSJxxXUMJJm-3u2ra2KRHE3CSTkm0m-ktUrzoII3wqQ59OjECyYPW22tI Message-ID: Subject: Re: Possible G2-item at SERIALIZABLE To: pgsql-bugs@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" X-CLOUD-SEC-AV-Sent: true X-CLOUD-SEC-AV-Info: percona,google_mail,monitor X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello > AFAIU SSI docs do not describe this case clearly. I agree on that part. > Do you think that recovering serialization error with ROLLBACK TO SAVEPOINT is a bug? It does seem like a bug to me. s1 reads row 2, writes row 1, commits first s2 writes row 2, then reads row 1 inside a savepoint which gets rolled back s1 --> s2 (s1 read row 2 before s2 wrote it) s2 --> s1 (s2 read row 1 before it saw s1's write) Serialization is defined over what each transaction observed ("SSI is based on the observation"), and whether those observations can be arranged into one consistent order. I think a rolled-back read still matters because we can't roll back the fact that the transaction observed state. Also, if we try to use the rolled back read for something later, like this: SAVEPOINT s; SELECT (balance >= 100) AS do_bonus FROM accounts WHERE id = 1 \gset ROLLBACK TO SAVEPOINT s; \if :do_bonus UPDATE accounts SET bonus = bonus + 10 WHERE id = 2; \endif COMMIT; it will abort on master, the questionable behavior only happens if the read is unused. Based on this, I think even an unused read should correctly abort for consistency. I think we can also argue for this based on the point about locking from README-SSI: "Because reads in a subtransaction may cause that subtransaction to roll back, thereby affecting what is written by the top level transaction, predicate locks must survive a subtransaction rollback."