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 D3563200B67 for ; Tue, 2 Aug 2016 04:37:13 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id BBCA3160AA7; Tue, 2 Aug 2016 02:37:13 +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 DC28B160A6C for ; Tue, 2 Aug 2016 04:37:12 +0200 (CEST) Received: (qmail 23018 invoked by uid 500); 2 Aug 2016 02:37:12 -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 23006 invoked by uid 99); 2 Aug 2016 02:37:11 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Aug 2016 02:37:11 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5F249C03BC for ; Tue, 2 Aug 2016 02:37:11 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-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 (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 0Hgzp7wZq1H3 for ; Tue, 2 Aug 2016 02:37:09 +0000 (UTC) Received: from mail-qk0-f181.google.com (mail-qk0-f181.google.com [209.85.220.181]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 622F75F295 for ; Tue, 2 Aug 2016 02:37:09 +0000 (UTC) Received: by mail-qk0-f181.google.com with SMTP id p74so163103139qka.0 for ; Mon, 01 Aug 2016 19:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=FhD4IKY2+KgBnYDavGP/3v8F/oR1TgeRuWl6O6YSC38=; b=UVeCgaQJWpllN3nAFjlXx9aqT522Yfp/cMz93qUPgzFQFVpjIrkD4sRXXuYOjYrGyv phmgw0VEfhB2XkcRe6nyWQGYbpFGIINk/jT5TArJKS29e5J0bk+p4ItdfhG8s81YtvNH pu8/r7XBn3mGuoNOiqGSIpsfSHLk57i9N8N4cGtUnIE1GVaF5CfolMgKGINrUyNvZ8WV qJj2uLAfZKVSWz0YLqF5SQv1amkkGMDHSelFoxBGiC0dYofqRyRlGtIdjmt670XTYIVp uvVKJ7x0jGRP81QlTNYKvVtzd8qlzQ8P1J39R0q9BiFCHtOv/TDbERgOWo9GdEnHyOOI mzgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=FhD4IKY2+KgBnYDavGP/3v8F/oR1TgeRuWl6O6YSC38=; b=JioUvaPBXvHEnbbbGzJIVLjQSr4Y3mk147tZVDaXrs9i922b5DslHoJrbBuDURXX5N HbUw8VKKt49ZdsX6SRC1yn5N+BOf0RuQTFI6nPfXxiHyQ/gmDJXLYifByCWFnHHM05z9 UZAK9VNQqTzyu5qYemwUezGvmiscmJIG3i1p8eTqF3s7lGMeA6Ps75Ux1NGE6TkLleZO lKtvQhDuvYXCT1drqolR85RwCsPGdzGTeKAHQeJn+Gv+KCBG3cWC6EYTZMQvMIydFSxk EIkq9xXBBLQ3L47TWUDuKH6Ljkrb2k7wmGkYFJTygoULVE3SX0Iuna1un/w88EaiJSBT tjrQ== X-Gm-Message-State: AEkoousbPsIkV8qX3kNnOh4HVIqCqncVtwEaLJM1MvNGLl3jjFFBOMhI5duK/hEIeHL2QSpSGNu0uGfq8qUMKg== X-Received: by 10.55.178.195 with SMTP id b186mr67030966qkf.81.1470105428783; Mon, 01 Aug 2016 19:37:08 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.51.187 with HTTP; Mon, 1 Aug 2016 19:36:38 -0700 (PDT) In-Reply-To: References: From: Valentin Kulichenko Date: Mon, 1 Aug 2016 19:36:38 -0700 Message-ID: Subject: Re: Multi-cache transactions & persistent store To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=94eb2c06ee04dd9b5f05390d979b archived-at: Tue, 02 Aug 2016 02:37:14 -0000 --94eb2c06ee04dd9b5f05390d979b Content-Type: text/plain; charset=UTF-8 Hi Igor, In a multi-cache transaction there can several different stores involved, that's why store is not considered to be self-contained. That's why transaction callbacks moved to a separate entity - store session listener. Can you please clarify how do you suggest to use Transaction for this? This interface is not implemented by a user, so it's not clear to me. -Val On Fri, Jul 29, 2016 at 6:40 PM, Igor Rudyak wrote: > Hi guys, > > Playing with Ignite multi-cache transactions(transactions involving > multiple caches) we run into the lack of proper/easy mechanism to support > such transactions on persistent store side (while implementing particular > *CacheStore*). > > The problem is there is no easy way for *CacheStore *implementation to get > information about caches involved in the transaction. > > Here are more details: > > When committing multi-cache transaction, Ignite produces multiple > *sessionEnd(...)* calls (in *CacheStore *implementation) - one for each > cache. Thus to support multi-cache transaction in persistent store, we need > to accumulate all the changes made to multiple caches (by > *write/writeAll/delete/deleteAll* operations) and apply them as one > transaction/batch to a persistent store in the final(last) *sessionEnd > *call. > To do this we need to know exact number of caches participating in the > transaction. Having this number we can skip all *sessionEnd *calls except > the last - which we will use to commit/persist all the changes we > previously accumulated. > > As for now, the only way to get the number of caches participating in a > transaction is to register *CacheStoreSessionListener *and count number of > caches in its "*onSessionStart*" method. Such approach doesn't look very > elegant cause we always need to keep in mind that specifying " > *cacheStoreFactory*" in cache configuration is not enough. In addition to > this we also need to specify appropriate " > *cacheStoreSessionListenerFactories*" property - otherwise it will not work > for multi-cache transactions. > > Here is an example chunk from cache configuration: > > * * > * > class="org.apache.ignite.cache.store.cassandra.CassandraCacheStoreFactory">* > * * > * value="cache1_persistence_settings"/>* > * * > * * > * * > * * > * * > * * > * * > > We see that, instead of specifying only one property "*cacheStoreFactory*" > for a cache we should always specify two properties in case we need > multi-cache transactions support in persistent store. Conceptually it > doesn't look good, cause users thinking about *CacheStore *implementation > like something self-contained - once it specified in cache configuration > everything should be smooth. But in case of multi-cache transactions > support we always need to remember about registering some strange > "listener". > > In Ignite we already have such concept as " > *org.apache.ignite.transactions.Transaction*" which defines our > transaction. It looks logical if it will also provide information about > transaction boundaries (caches involved into transaction). Such approach > can simplify persistent store implementation for multi-cache transactions. > > Any thoughts? > > > Igor Rudyak > --94eb2c06ee04dd9b5f05390d979b--