From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp37.i.mail.ru (smtp37.i.mail.ru [94.100.177.97]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id BF54D445320 for ; Thu, 16 Jul 2020 03:11:41 +0300 (MSK) References: <1594821336-14468-1-git-send-email-alyapunov@tarantool.org> <1594821336-14468-10-git-send-email-alyapunov@tarantool.org> From: Vladislav Shpilevoy Message-ID: Date: Thu, 16 Jul 2020 02:11:40 +0200 MIME-Version: 1.0 In-Reply-To: <1594821336-14468-10-git-send-email-alyapunov@tarantool.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v3 09/13] tmx: introduce prepare sequence number List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Aleksandr Lyapunov , tarantool-patches@dev.tarantool.org Thanks for the patch! On 15.07.2020 15:55, Aleksandr Lyapunov wrote: > Prepare sequence number is a monotonically increasing ID that is > assigned to any prepared transaction. This ID is suitable for > serialization order resolution: the bigger is ID - the latter the 1. Latter -> later. > transaction exist in the serialization order of transactions. 2. What it means 'later in the order'? It can mean both older and newer depending on from where to count. Would be better to call it explicitly 'newer' or 'older'. > Note that id of transactions has quite different order in case > when transaction could yield - an younger (bigger id) transaction > can prepare/commit first (lower psn) while older tx sleeps in vain. > > Also it should be mentioned that LSN has the same order as PSN, > but it has two general differences: > 1. The LSN sequence has no holes, i.e. it is a natural number > sequence. This property is useless for transaction engine. > 2. The LSN sequence is provided by WAL writer and thus LSN is not > available for TX thas was prepared and haven't been committed yet. > That feature makes psn more suitable sequence for transactions as > it allows to order prepared but not committed transaction and > allows, for example, to create a read view between prepared > transactions.