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 1sex3t-00EiHR-F5 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Aug 2024 13:32:13 +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 1sex3s-005R5j-0F for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Aug 2024 13:32:12 +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 1sex3r-005R5b-Lu for pgsql-hackers@lists.postgresql.org; Fri, 16 Aug 2024 13:32:11 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sex3p-0051oh-Dg for pgsql-hackers@postgresql.org; Fri, 16 Aug 2024 13:32:10 +0000 Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-a7a94478a4eso532909366b.1 for ; Fri, 16 Aug 2024 06:32:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1723815128; x=1724419928; darn=postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=zQ9DwpjWrhuC/ofB/gP+wgyX6w4PTmNBPC67nF/Hnvo=; b=cmJxjZrAlc1boCyIYr4w5/2fruILoG7/sGW3t+w1IE07g/BukeOidjhZUUeYpCpvoU 88XOkdw6BAI2gfgluGaTH/dn51y+U5DvHDn3/u3/daV9nNBHujEuEJ1gb2B8TjuLPfod +ulZwk61cyewH/P4ezG7S9jl6DVqtwMNoMs7HofXxSagnd3j36GArZC5n48VOqadHHdW Xm0lLvnY7j+mlAjwexBp6aXt8vn1kSxUqJzqPV5wy9/MWmvn/ZaXwIVBwFpmqFn+w6bW cyMwwVro0/AbNs4hQ2hLO9po7VjanK+JCksrFxGsnteDruO9dbvl8zavXOG4aCrC0ibJ xcGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723815128; x=1724419928; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zQ9DwpjWrhuC/ofB/gP+wgyX6w4PTmNBPC67nF/Hnvo=; b=Zeq8DjGav+xxbF5aMQGTPODzxLXaj5ZjkBKXVDFEBtLjsXrdWWj8kbOt81Q+4lYOth nTFj63UWKTr80J4q46Vad9pyuu5ydBeNED+qDUxdL0lSF6DQie5qcerhLUybrHB61+3Q k78jSEu60siO1MV6rjs7ftTcNrSipDaj+8gs1kVo0v0vB6gW7RBIjAGbBRSRXW7QQ98O 4qN09ZMUqO1SNXUi7WlfMLm/8XR5W8iB38p2fQF726f2loKv/cp5WoV+PKYWmNSiorVD 5vS0H+IibcWJBlb+tSVSNfkeOt6FVHPaW3rIRcmy/TJK3L6vItNzD+zyNagftDQZN/T/ O+Hw== X-Forwarded-Encrypted: i=1; AJvYcCX8waunxJ03tDOibOD3K3QSKMLUfe3571ovZG8jEU1R0AB0JFJJfe+F5IziGu0ptTBLa6/KhqcCKB2I/NxW9WQb66rSAZN4HdNj9HHY X-Gm-Message-State: AOJu0Yy7+PDKAEbGRtCXdBAA58a60VU1Cls/desWB4CbiI5a7BSDWni0 rxumTumYzP7/Cj+b/ffI85YPsSNj8kJYCJAfr+agYyNRloRUPcR5JLVPa43dslfZ+NW1YSBXnA+ ZDqVSzQmz2j3V7IlGxhRSbpQ7LgQ= X-Google-Smtp-Source: AGHT+IHuX+Af4gz0xeF5cSKhODmqAkaxLRzihDhabybvFF7zvwETOBHd95lfby5VS+ZzbfCryNsTjf5sHpEtleisEak= X-Received: by 2002:a17:907:9451:b0:a77:ca9d:1d46 with SMTP id a640c23a62f3a-a837ce7f1b0mr444248566b.33.1723815127592; Fri, 16 Aug 2024 06:32:07 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Michail Nikolaev Date: Fri, 16 Aug 2024 15:31:55 +0200 Message-ID: Subject: Re: [BUG?] check_exclusion_or_unique_constraint false negative To: "Zhijie Hou (Fujitsu)" Cc: Amit Kapila , "Hayato Kuroda (Fujitsu)" , PostgreSQL Hackers , Andres Freund Content-Type: multipart/alternative; boundary="00000000000056ba44061fccfcf5" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --00000000000056ba44061fccfcf5 Content-Type: text/plain; charset="UTF-8" Hello! > In addition, I think the bug is not a blocker for the conflict detection > feature. As the feature simply reports the current behavior of the logical > apply worker (either unique violation or tuple missing) without introducing any > new functionality. Furthermore, I think that the new ExecCheckIndexConstraints > call after ExecInsertIndexTuples() is not affected by the dirty snapshot bug. > This is because a tuple has already been inserted into the btree before the > dirty snapshot scan, which means that a concurrent non-HOT update would not be > possible (it would be blocked after finding the just inserted tuple and wait > for the apply worker to commit the current transaction). > It would be good if others could also share their opinion on this. Yes, you are right. At least, I can't find any scenario for that case. Best regards, Mikhail. --00000000000056ba44061fccfcf5 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello!

> In addition, I think the bu= g is not a blocker for the conflict detection
>=C2=A0feature. As the = feature simply reports the current behavior of the logical
>=C2=A0app= ly worker (either unique violation or tuple missing) without introducing an= y
>=C2=A0new functionality. Furthermore, I think that the new ExecChe= ckIndexConstraints
>=C2=A0call after ExecInsertIndexTuples() is not a= ffected by the dirty snapshot bug.
>=C2=A0This is because a tuple has= already been inserted into the btree before the
>=C2=A0dirty snapsho= t scan, which means that a concurrent non-HOT update would not be
>= =C2=A0possible (it would be blocked after finding the just inserted tuple a= nd wait
>=C2=A0for the apply worker to commit the current transaction= ).

> It would be good if others could also = share their opinion on this.

Yes, you are right. At least, I = can't find any scenario for that case.

Best re= gards,
Mikhail.
--00000000000056ba44061fccfcf5--