Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 91C6B2007D1 for ; Thu, 12 May 2016 11:14:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 909CE160939; Thu, 12 May 2016 09:14:14 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id CB4BA160A10 for ; Thu, 12 May 2016 11:14:13 +0200 (CEST) Received: (qmail 57896 invoked by uid 500); 12 May 2016 09:14:13 -0000 Mailing-List: contact issues-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ignite.apache.org Delivered-To: mailing list issues@ignite.apache.org Received: (qmail 57853 invoked by uid 99); 12 May 2016 09:14:12 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 May 2016 09:14:12 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id D216E2C1F5C for ; Thu, 12 May 2016 09:14:12 +0000 (UTC) Date: Thu, 12 May 2016 09:14:12 +0000 (UTC) From: "Denis Magda (JIRA)" To: issues@ignite.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (IGNITE-2426) Document optimisitic (deadlock-free) transactions on readme.io MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Thu, 12 May 2016 09:14:14 -0000 [ https://issues.apache.org/jira/browse/IGNITE-2426?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Denis Magda resolved IGNITE-2426. --------------------------------- Resolution: Fixed > Document optimisitic (deadlock-free) transactions on readme.io > -------------------------------------------------------------- > > Key: IGNITE-2426 > URL: https://issues.apache.org/jira/browse/IGNITE-2426 > Project: Ignite > Issue Type: Bug > Affects Versions: 1.5.0.final > Reporter: Denis Magda > Priority: Critical > Labels: important > Fix For: 1.6 > > Attachments: TransactionTest.java > > > There is a lack of documentation on how optimistic & serializable transactions work. > Basic documentation has to be added covering some specific cases in addition. > As an example, the test attached demonstrates the following. > Both tasks update cache with put operations only without reading and keeping entries's versions cause there is no any cache.get/getAll calls as a part of the transaction. > Each transaction has it's unique ID. So at the commit time when one transaction B tries to update an entry locking it before and sees that the entry is locked by some transaction A, started earlier (have smaller transaction ID), then transaction B will just wait until the lock is released and can proceed with the commit later. If this repeats for every entry of transactions and we haven't detected any conflict then both transactions succeeds. This is exactly what happens sometimes in your test. > However, if the transactions were using cache.get or related operations then during the commit time both transactions would be checking entry versions in addition before proceeding with the commit. In general if an entry version at commit time is different to the entry version at get time then a transaction fails. To see this in practice use cache.getAndPut() instead of cache.put() in the code. After applying this modification one of the transactions will always fail. -- This message was sent by Atlassian JIRA (v6.3.4#6332)