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 6CCF2200C36 for ; Fri, 10 Mar 2017 15:25:27 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 6B59E160B79; Fri, 10 Mar 2017 14:25:27 +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 90CA0160B69 for ; Fri, 10 Mar 2017 15:25:26 +0100 (CET) Received: (qmail 52845 invoked by uid 500); 10 Mar 2017 14:25:25 -0000 Mailing-List: contact dev-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 dev@ignite.apache.org Received: (qmail 52833 invoked by uid 99); 10 Mar 2017 14:25:25 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 10 Mar 2017 14:25:25 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id F2C8EC202E for ; Fri, 10 Mar 2017 14:25:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.303 X-Spam-Level: *** X-Spam-Status: No, score=3.303 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_REPLY=1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.096, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id Ghd4FY9YP6ov for ; Fri, 10 Mar 2017 14:25:22 +0000 (UTC) Received: from mail-ua0-f172.google.com (mail-ua0-f172.google.com [209.85.217.172]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 50D2C60DFC for ; Fri, 10 Mar 2017 14:25:22 +0000 (UTC) Received: by mail-ua0-f172.google.com with SMTP id u30so116366149uau.0 for ; Fri, 10 Mar 2017 06:25:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=sUkIL71n6gjMZEZJucNrj40y5DSEy9ZIdLXovk9laP8=; b=lg9pJi7i4JsVEFdLprys3ls18liQ7gQCtN0Y+gejaijEIBHtZC5M/JwJN6Ab/c004V FF2G3vf07CKYC1BMh233kC9GR5IBB1/WcwoJiiZMskBxdhnW3lLPoqiEllFOKO4wl+5U js9PXIbrBitP6B3b1ZkTmgdeCCemzdbmJ1O7UHRFZYRgIPaH0xzyVYQ7CF+47JIrh8HP d/FC7zAxr72VL+h+8vWsUvpbDZKp7UtfX6Q6U4gdLvpX/bF4tE5O0QtAutmtbad0WV3l U9ENo7L9sEbyHsTIreMbu0uvBkAucfUT3y8WvWkDuPxsme3VjqEnFlxsUcvyAiqotX8K sqqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=sUkIL71n6gjMZEZJucNrj40y5DSEy9ZIdLXovk9laP8=; b=C+notL07CrhYB7XXs9iok3esAOdb2xiw/GmKdFhui5pyma7mzxH71ZqCuJilIn9vNk a2n9YNAEXM9UMLcxazICWval49SKx4+f9R7OVsJo9vwBAh5O4Vq6+bHMJ+SCKJ6AvOdq ewhF30g3Ofo62kGPsh2ykwtaNj+o6pXDJr5DTV4KWiJpQHgRRlZs/PwS0sXEh22+WXo2 jTzYTqtvo/uk96gt8Ix6FxWh2O8w+0Z5VK2OkMK5QNwDsCiDSaZ2yvI6qHsd2rA/Qaox HJjRSGRjOvu2qrCLDHi/6OpM39yhNgQ9pYPzM9l9Dzt1RybWm+u62jHWN4HeBCYWvZ22 w28Q== X-Gm-Message-State: AMke39kJDVR7jVJJQQvWIwWxBDifUSl34gMt7PTsieauyNmUPr1Ge2kTXvJBJ2HEflEL8jK2jjd6bp0cwEjfHQ== X-Received: by 10.176.74.68 with SMTP id r4mr9499876uae.55.1489155921220; Fri, 10 Mar 2017 06:25:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.86.68 with HTTP; Fri, 10 Mar 2017 06:25:20 -0800 (PST) In-Reply-To: References: <3ADB0EBF-5355-4E17-BA55-062C126D6219@apache.org> From: Alexey Goncharuk Date: Fri, 10 Mar 2017 17:25:20 +0300 Message-ID: Subject: Re: distributed transaction of non-single coordinator To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=f403045f8e9cb31b97054a612189 archived-at: Fri, 10 Mar 2017 14:25:27 -0000 --f403045f8e9cb31b97054a612189 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Aleksey, I think I am starting to get what you want, but I have a few concerns: - What is the API for the proposed change? In your test, you pass an instance of transaction created on ignite(0) to the ignite instance ignite(1). This is obviously not possible in a truly distributed (multi-jvm) environment. - How will you synchronize cache update actions and transaction commit? Say, you have one node that decided to commit, but another node is still writing within this transaction. How do you make sure that two nodes will not call commit() and rollback() simultaneously? - How do you make sure that either commit() or rollback() is called if an originator failed? 2017-03-10 15:38 GMT+03:00 =D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9 =D0= =A0=D1=8F=D0=B1=D0=BE=D0=B2 : > Alexey Goncharuk, heh, my initial understanding was that transferring of = tx > ownership from one node to another will be happened automatically when > originating node is gone down. > > 2017-03-10 15:36 GMT+03:00 ALEKSEY KUZNETSOV : > > > Im aiming to span transaction on multiple threads, nodes, jvms(soon). S= o > > every node is able to rollback, or commit common transaction.It turned > up i > > need to transfer tx between nodes in order to commit transaction in > > different node(in the same jvm). > > > > =D0=BF=D1=82, 10 =D0=BC=D0=B0=D1=80. 2017 =D0=B3. =D0=B2 15:20, Alexey = Goncharuk < > alexey.goncharuk@gmail.com > > >: > > > > > Aleksey, > > > > > > Do you mean that you want a concept of transferring of tx ownership > from > > > one node to another? My initial understanding was that you want to be > > able > > > to update keys in a transaction from multiple threads in parallel. > > > > > > --AG > > > > > > 2017-03-10 15:01 GMT+03:00 ALEKSEY KUZNETSOV >: > > > > > > > Well. Consider transaction started in one node, and continued in > > another > > > > one. > > > > The following test describes my idea: > > > > > > > > Ignite ignite1 =3D ignite(0); > > > > > > > > IgniteTransactions transactions =3D ignite1.transactions(); > > > > > > > > IgniteCache cache =3D ignite1.getOrCreateCache(" > > > > testCache"); > > > > > > > > Transaction tx =3D transactions.txStart(concurrency, isolation); > > > > > > > > cache.put("key1", 1); > > > > > > > > cache.put("key2", 2); > > > > > > > > tx.stop(); > > > > > > > > IgniteInternalFuture fut =3D GridTestUtils.runAsync(() -> = { > > > > IgniteTransactions ts =3D ignite(1).transactions(); > > > > Assert.assertNull(ts.tx()); > > > > Assert.assertEquals(TransactionState.STOPPED, tx.state()); > > > > ts.txStart(tx); > > > > Assert.assertEquals(TransactionState.ACTIVE, tx.state()); > > > > cache.put("key3", 3); > > > > Assert.assertTrue(cache.remove("key2")); > > > > tx.commit(); > > > > return true; > > > > }); > > > > > > > > fut.get(); > > > > > > > > Assert.assertEquals(TransactionState.COMMITTED, tx.state()); > > > > Assert.assertEquals((long)1, (long)cache.get("key1")); > > > > Assert.assertEquals((long)3, (long)cache.get("key3")); > > > > Assert.assertFalse(cache.containsKey("key2")); > > > > > > > > In method *ts.txStart(...)* we just rebind *tx* to current thread: > > > > > > > > public void txStart(Transaction tx) { > > > > TransactionProxyImpl transactionProxy =3D (TransactionProxyImpl= )tx; > > > > cctx.tm().reopenTx(transactionProxy.tx()); > > > > transactionProxy.bindToCurrentThread(); > > > > } > > > > > > > > In method *reopenTx* we alter *threadMap* so that it binds > transaction > > > > to current thread. > > > > > > > > How do u think about it ? > > > > > > > > > > > > =D0=B2=D1=82, 7 =D0=BC=D0=B0=D1=80. 2017 =D0=B3. =D0=B2 22:38, Deni= s Magda : > > > > > > > > > Hi Alexey, > > > > > > > > > > Please share the rational behind this and the thoughts, design > ideas > > > you > > > > > have in mind. > > > > > > > > > > =E2=80=94 > > > > > Denis > > > > > > > > > > > On Mar 7, 2017, at 3:19 AM, ALEKSEY KUZNETSOV < > > > > alkuznetsov.sb@gmail.com> > > > > > wrote: > > > > > > > > > > > > Hi all! Im designing distributed transaction which can be start= ed > > at > > > > one > > > > > > node, and continued at other one. Has anybody thoughts on it ? > > > > > > -- > > > > > > > > > > > > *Best Regards,* > > > > > > > > > > > > *Kuznetsov Aleksey* > > > > > > > > > > -- > > > > > > > > *Best Regards,* > > > > > > > > *Kuznetsov Aleksey* > > > > > > > > > -- > > > > *Best Regards,* > > > > *Kuznetsov Aleksey* > > > --f403045f8e9cb31b97054a612189--