From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 49E6A6EC57; Sat, 12 Jun 2021 01:02:32 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 49E6A6EC57 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1623448952; bh=sX69BIEPRkUXfxakK5VMr5xBUm3f6BlkvqJJSYKcsrM=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=dZu0FOw3OjbGKjK9ViWafoJLfyuObOQI1fBK0+wHo/zVF6mqYywP4PZIjcJAAm0K4 w0gYO31ELnAE2AGbs+F0qXIVMDaKMO/fpysUkPUq6Ry8TXg53U6liC3l34LqumW5tV NilXgfbm4eCrOI8EeZ+lP1pjIc0RAhLX80J1/A/0= Received: from smtpng3.m.smailru.net (smtpng3.m.smailru.net [94.100.177.149]) (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 4A7386F3CA for ; Sat, 12 Jun 2021 00:56:35 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 4A7386F3CA Received: by smtpng3.m.smailru.net with esmtpa (envelope-from ) id 1lrp8k-0008JK-Jj; Sat, 12 Jun 2021 00:56:35 +0300 To: tarantool-patches@dev.tarantool.org, gorcunov@gmail.com, sergepetrenko@tarantool.org Date: Fri, 11 Jun 2021 23:56:15 +0200 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-7564579A: 646B95376F6C166E X-77F55803: 4F1203BC0FB41BD9D5B0DA836B685C54F4BC37E91F2690B85F43D7652182C513182A05F5380850405C5426652986DD1B7B21AE65F975461C52F8FC7BA78E0AD341EB5ACC85362586 X-7FA49CB5: FF5795518A3D127A4AD6D5ED66289B5278DA827A17800CE792C68BF9CD4C0E9EEA1F7E6F0F101C67BD4B6F7A4D31EC0BCC500DACC3FED6E28638F802B75D45FF8AA50765F7900637CF05F7050DCA185A8638F802B75D45FF36EB9D2243A4F8B5A6FCA7DBDB1FC311F39EFFDF887939037866D6147AF826D89FC465F74B2E6D4FFD220DF34A4D5C53117882F4460429724CE54428C33FAD305F5C1EE8F4F765FCE96A3A8AAADC8934A471835C12D1D9774AD6D5ED66289B52BA9C0B312567BB23117882F4460429728776938767073520599709FD55CB46A6F6B57BC7E6449061A352F6E88A58FB86F5D81C698A659EA7E827F84554CEF5019E625A9149C048EE9ECD01F8117BC8BEE2021AF6380DFAD18AA50765F790063735872C767BF85DA227C277FBC8AE2E8B9F5955FECEF5819E75ECD9A6C639B01B4E70A05D1297E1BBCB5012B2E24CD356 X-B7AD71C0: AC4F5C86D027EB782CDD5689AFBDA7A2AD77751E876CB595E8F7B195E1C978317387390EF8EF1240BC778C3F84A8D0C8 X-C1DE0DAB: C20DE7B7AB408E4181F030C43753B8183A4AFAF3EA6BDC44C234C8B12C006B7A1906CDB4DF5A729061EF3CF4C36ECF1B9B440FDCCED3124EB1881A6453793CE9C32612AADDFBE061C61BE10805914D3804EBA3D8E7E5B87ABF8C51168CD8EBDB791E6C230873D55CDC48ACC2A39D04F89CDFB48F4795C241BDAD6C7F3747799A X-C8649E89: 4E36BF7865823D7055A7F0CF078B5EC49A30900B95165D3444047AE358B407549721CC309EB60041C6D7127F68BA3EB0775A32D98346F3ACAC0BFE6A09402EB91D7E09C32AA3244C97ABF72CAD566335FC98D196ABDFF7E61E098CBE561D6343FACE5A9C96DEB163 X-D57D3AED: 3ZO7eAau8CL7WIMRKs4sN3D3tLDjz0dLbV79QFUyzQ2Ujvy7cMT6pYYqY16iZVKkSc3dCLJ7zSJH7+u4VD18S7Vl4ZUrpaVfd2+vE6kuoey4m4VkSEu530nj6fImhcD4MUrOEAnl0W826KZ9Q+tr5ycPtXkTV4k65bRjmOUUP8cvGozZ33TWg5HZplvhhXbhDGzqmQDTd6OAevLeAnq3Ra9uf7zvY2zzsIhlcp/Y7m53TZgf2aB4JOg4gkr2biojQR1NM653rVGQcma0McN1Bw== X-Mailru-Sender: 689FA8AB762F73936BC43F508A063822125A60906206670D99E58698BAE1D30F3841015FED1DE5223CC9A89AB576DD93FB559BB5D741EB963CF37A108A312F5C27E8A8C3839CE0E267EA787935ED9F1B X-Mras: Ok Subject: [Tarantool-patches] [PATCH 07/13] txn: change limbo rollback check in the trigger X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Vladislav Shpilevoy via Tarantool-patches Reply-To: Vladislav Shpilevoy Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" A transaction on rollback used to check if it was already rolled back inside of the limbo by looking at its signature as signature != TXN_SIGNATURE_ROLLBACK It meant the transaction is already completed. TXN_SIGNATURE_ROLLBACK was used as a default value of the signature. Therefore if it is not default, it is completed. This is going to break if normal (not synchronous) transactions would have more rollback codes except just TXN_SIGNATURE_ROLLBACK. Also treatment of TXN_SIGNATURE_ROLLBACK as a default value looks confusing. Next patches are going to rework the codes and render the assumptions above incorrect. This patch makes the transaction use a correct way to check whether it is in the limbo still - look at TXN_WAIT_SYNC flag. It is set for all txns in the limbo and is not set for all the others. Part of #6027 --- src/box/txn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/box/txn.c b/src/box/txn.c index ac11127d3..2c889a31a 100644 --- a/src/box/txn.c +++ b/src/box/txn.c @@ -773,7 +773,7 @@ txn_limbo_on_rollback(struct trigger *trig, void *event) (void) event; struct txn *txn = (struct txn *) event; /* Check whether limbo has performed the cleanup. */ - if (txn->signature != TXN_SIGNATURE_ROLLBACK) + if (!txn_has_flag(txn, TXN_WAIT_SYNC)) return 0; struct txn_limbo_entry *entry = (struct txn_limbo_entry *) trig->data; txn_limbo_abort(&txn_limbo, entry); -- 2.24.3 (Apple Git-128)