Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7rtv-0003pt-II for pgsql-hackers@arkaria.postgresql.org; Sun, 24 Mar 2019 01:26:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h7rtu-0004iC-2R for pgsql-hackers@arkaria.postgresql.org; Sun, 24 Mar 2019 01:26:14 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7rts-0004hs-4p for pgsql-hackers@lists.postgresql.org; Sun, 24 Mar 2019 01:26:13 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h7rto-0007kj-L1 for pgsql-hackers@postgresql.org; Sun, 24 Mar 2019 01:26:11 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0E719218A8; Sat, 23 Mar 2019 21:26:07 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sat, 23 Mar 2019 21:26:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= from:to:cc:subject:in-reply-to:reply-to:date:message-id :mime-version:content-type; s=fm1; bh=NBeVrLHTkIB/zeVujpDBwX2qil 9HUZp3S49z7yEF7Do=; b=wDciUH/Gb2d/eSVSHcJhKVvDOspXQskAKiRKiU131i i1WrwKT4v0UhCrTeXEVgstp4Dx22Hcrp+w9u/xmP4TU6gRj3eCssHPpNX4HvphBp VEsoFEwP3B9s/05I+RB+0ReOhAOap3EH7oYdagMjLWh/rYq4s6EUfLDMJYTXmCTx Njc/lq9yJB0wYfnxIKqaWgRxcyiacN16UaYeS2Ulw12J1TZmsXin7N/So+OkY8i0 BIgKCDaAsYQtPPFYDdmnT89puLmbteg75qhZ5LDHuya7Ecno2GRrGP1bW9N5+dwJ QspDEF7q/8QSs7oCSxHvrQwjQCjnw6462G8PvdquNG8Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:reply-to:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=NBeVrL HTkIB/zeVujpDBwX2qil9HUZp3S49z7yEF7Do=; b=gu93JhejkKl6NcDZWcoln7 FpqDXmZujZ5Lb5tAx+Tif2w6FwxOhmh0IgTCqARsfkJeVtRejLN14Z63nlA6p7fN YxJJqY6AfwLl0Jq7GLtZ5RyaWYi8LMjuObXqstF7++mtm4zeKYhOh5eBex3CpFMg tzLduKeAQ16EltjkgcSVk+gIdH+lIRh5bl2WXdmb1Q/D2blZ1cDK2qVHKuP1qmdn nPgvS7u6e3+462Hu1i5ALbTrlKs4J9lIRWoAsSVU9cEuYx5G78+ATcjx/EKldQ5D MGmosfwRkKShDF6mWvwQ3wYWjtWr2qC11+uq3hKcQbRpuHK6M+vRHWGPkXnuzm7w == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrjeeggdefgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghrfffkgggtsehttdertddttddtnecuhfhrohhmpeetnhgurhgvshcu hfhrvghunhguuceorghnughrvghssegrnhgrrhgriigvlhdruggvqeenucfkphepleekrd dvuddtrddugedtrddujedunecurfgrrhgrmhepmhgrihhlfhhrohhmpegrnhgurhgvshes rghnrghrrgiivghlrdguvgenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from intern.anarazel.de (c-98-210-140-171.hsd1.ca.comcast.net [98.210.140.171]) by mail.messagingengine.com (Postfix) with ESMTPA id BBB68E4549; Sat, 23 Mar 2019 21:26:05 -0400 (EDT) From: Andres Freund To: Haribabu Kommi Cc: Heikki Linnakangas , Asim R P , Pg Hackers , Ashwin Agrawal , Dmitry Dolgov <9erthalion6@gmail.com>, Alvaro Herrera , Alexander Korotkov Subject: Re: Pluggable Storage - Andres's take In-Reply-To: <20190321181557.o7sx6ul47t2ojjcm@alap3.anarazel.de> Reply-To: Date: Sat, 23 Mar 2019 18:26:03 -0700 Message-ID: <8736ndm5as.fsf@alap4.lan> MIME-Version: 1.0 Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hi, On 2019-03-21 11:15:57 -0700, Andres Freund wrote: > Pending work: > - Wondering if table_insert/delete/update should rather be > table_tuple_insert etc. Would be a bit more consistent with the > callback names, but a bigger departure from existing code. I've left this as is. > - I'm not yet happy with TableTupleDeleted computation in heapam.c, I > want to revise that further I changed that. Found a bunch of untested paths, I've pushed tests for those already. > - formatting Done that. > - commit message Done that. > - a few comments need a bit of polishing (ExecCheckTIDVisible, heapam_tuple_lock) Done that. > - Rename TableTupleMayBeModified to TableTupleOk, but also probably a s/TableTuple/TableMod/ It's now TM_*. /* * Result codes for table_{update,delete,lock}_tuple, and for visibility * routines inside table AMs. */ typedef enum TM_Result { /* * Signals that the action succeeded (i.e. update/delete performed, lock * was acquired) */ TM_Ok, /* The affected tuple wasn't visible to the relevant snapshot */ TM_Invisible, /* The affected tuple was already modified by the calling backend */ TM_SelfModified, /* * The affected tuple was updated by another transaction. This includes * the case where tuple was moved to another partition. */ TM_Updated, /* The affected tuple was deleted by another transaction */ TM_Deleted, /* * The affected tuple is currently being modified by another session. This * will only be returned if (update/delete/lock)_tuple are instructed not * to wait. */ TM_BeingModified, /* lock couldn't be acquired, action skipped. Only used by lock_tuple */ TM_WouldBlock } TM_Result; > - I'll probably move TUPLE_LOCK_FLAG_LOCK_* into tableam.h Done. > - two more passes through the patch One of them completed. Which is good, because there was a subtle bug in heapam_tuple_lock (*tid was adjusted to be the followup tuple after the heap_fetch(), before going to heap_lock_tuple - but that's wrong, it should only be adjusted when heap_fetch() ing the next version.). Greetings, Andres Freund