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 19782200D0F for ; Fri, 15 Sep 2017 02:07:59 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 181131609CE; Fri, 15 Sep 2017 00:07:59 +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 3864F1609CD for ; Fri, 15 Sep 2017 02:07:58 +0200 (CEST) Received: (qmail 1206 invoked by uid 500); 15 Sep 2017 00:07:56 -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 1194 invoked by uid 99); 15 Sep 2017 00:07:56 -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, 15 Sep 2017 00:07:56 +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 AA50DD613B for ; Fri, 15 Sep 2017 00:07:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.4 X-Spam-Level: X-Spam-Status: No, score=-0.4 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_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.8, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, URIBL_BLOCKED=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 x1S_c2EbSz2p for ; Fri, 15 Sep 2017 00:07:54 +0000 (UTC) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 4F6FF5FB57 for ; Fri, 15 Sep 2017 00:07:54 +0000 (UTC) Received: by mail-io0-f175.google.com with SMTP id e189so4685349ioa.4 for ; Thu, 14 Sep 2017 17:07:54 -0700 (PDT) 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=n12eS9OA8lpJLbDS47duwa6Qe7VJLv8i8PddGUjw+DE=; b=kC70fw1r+2TJSDUAGKHAkaVYPc+RK6abm10aDE7kFIuXWDr5Ft7B6W6JmoLe6ByJDk atKozoDF17E0e7595PqUEw5jXyb9UVKunRccANBRoGGaXWmgruKHQiPyOi9yAH+Ct09G vmbcxYJpVQl+1cPcx8sk2rHAcNDx4iSuDHo/N1UQsUuh2B6L/fs7Dc7EcCnPUrBKKZgF 49kupQmYepEKoWZUZn2v7sbyl+iQ00SjkcJtKwlgywgsmN3W3iBIJxCKFwvGxumibIjQ 8OoEl/ZTrnsI8d3uqhYFdu+7jc9CooGGI8o5h5SnU6b2WjoU11xXBb+keH8HwaZP5jIm xZhw== 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=n12eS9OA8lpJLbDS47duwa6Qe7VJLv8i8PddGUjw+DE=; b=g4CNrcTkxicGdpxB45IrDnKrRiJxh9He5rm0RpPJJqdITnzHbTN1TplvieLd1bCy72 yHoHRPPJ379w2jAgi3Mxf6B/7SY7ztqSn84K/6OF7N1AKhElm60qsgVZ+bpEMVcoQS6f 8ts14vTj+DSgdkLPWmhSvVmVW0S7ht025RqDSuDkvzGeSReE6SfDTY+eGAck24ZbmTfB s0turQ18YV2IEQ9HwT9SkObh0aXWBBsAA+i7zNVuPzQbFDwVYSnKXrgXpxzlI2ufvNC7 p7v8NwhF2J0iC+KLSBKFrhah3i7lY0lfaiLA/v5LnTrlBMsmKMs4BxlqRwJQUoK2uGo1 XTXg== X-Gm-Message-State: AHPjjUj31+hpl6YaR72trL5imdKDRf+s5/5xANWq9Jp6c2azrze4v9Xp DqwWEMvQXCTtj1ZAZCNBEC7wKiuyCgcqn4gxNgnwUCkr X-Google-Smtp-Source: AOwi7QDT5e5geIh+jqAzIBVjlMYHepdjA0OxxjHJ45kStYWojwSDvOKxbAadZ8tCRL+3S9Ed9AHkOivo0HNjmVJLqSE= X-Received: by 10.107.18.85 with SMTP id a82mr4997593ioj.251.1505434073382; Thu, 14 Sep 2017 17:07:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.149.147 with HTTP; Thu, 14 Sep 2017 17:07:22 -0700 (PDT) In-Reply-To: References: From: Valentin Kulichenko Date: Thu, 14 Sep 2017 17:07:22 -0700 Message-ID: Subject: Re: Expiry policy for Cache.invoke To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary="001a113ed6be2d4ce405592f2f55" archived-at: Fri, 15 Sep 2017 00:07:59 -0000 --001a113ed6be2d4ce405592f2f55 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Denis, This looks like a bug. In my understanding, getExpiryForAccess should be called for any update, plus one of getExpiryForCreation/getExpiryForUpdate depending on whether it's a new entry or not. And this definitely should not depend on cache mode. -Val On Thu, Sep 14, 2017 at 3:02 AM, Denis Mekhanikov wrote: > Dmitriy, > > You are right about transactions, but the spec describes invoke, so, if i= t > specifies some behavior in general, then it should be followed in both > cases. > > Here is the most relevant part I could find in the spec: > https://static.javadoc.io/javax.cache/cache-api/1.0.0/ > javax/cache/processor/EntryProcessor.html > I think, that if the value is loaded from CacheStore, then > getExpiryForCreation() should be used. Other methods should be called > depending on operations performed. > > Denis > > =D1=87=D1=82, 14 =D1=81=D0=B5=D0=BD=D1=82. 2017 =D0=B3. =D0=B2 12:02, Den= is Mekhanikov : > > > Val, > > > > Sorry, I may be didn't formulate the issue clearly. Other than predefin= ed > > expiry policies (like CreatedExpiryPolicy, AccessedExpiryPolicy, etc) y= ou > > can provide a custom expiry policy by calling > > setExpiryPolicyFactory(Factory) > > apache/ignite/configuration/CacheConfiguration.html# > setExpiryPolicyFactory(javax.cache.configuration.Factory)>. > > So, cache will consult the configured ExpiryPolicy by calling > > getExpiryForCreation(), getExpiryForAccess() or getExpiryForUpdate(), > > depending on the performed operation. > > > > So, the methods of ExpiryPolicy that are called when invoke(...) > > apache/ignite/IgniteCache.html#invoke(K,%20org.apache.ignite.cache. > CacheEntryProcessor,%20java.lang.Object...)> is > > used, somehow depend on the configured atomicity. Of course, the > configured > > ExpiryPolicy is used, but in some cases the wrong method is called. > > > > Denis > > > > =D1=87=D1=82, 14 =D1=81=D0=B5=D0=BD=D1=82. 2017 =D0=B3. =D0=B2 1:54, Va= lentin Kulichenko < > > valentin.kulichenko@gmail.com>: > > > >> Denis, > >> > >> I'm confused by the issue. Do you mean that we can use expiry policy > other > >> than the one provided in configuration? How is this possible? Can you > >> point > >> to the code that implements this logic? > >> > >> -Val > >> > >> On Wed, Sep 13, 2017 at 11:29 AM, Dmitriy Setrakyan < > >> dsetrakyan@apache.org> > >> wrote: > >> > >> > Denis, > >> > > >> > I agree that the behavior should be consistent, but you will not fin= d > >> > anything about transactions in JCache. To my knowledge, JCache does > not > >> > have transactions. > >> > > >> > I would file a ticket about the issue you found, so the community > could > >> > address it. If you are interested, perhaps you can contribute a fix > >> > yourself. > >> > > >> > Thanks, > >> > D. > >> > > >> > On Wed, Sep 13, 2017 at 5:47 AM, Denis Mekhanikov < > >> dmekhanikov@gmail.com> > >> > wrote: > >> > > >> > > Igniters! > >> > > > >> > > I noticed a weird behavior regarding expiry policy in Ignite. You > can > >> > find > >> > > an example in the attachment. > >> > > When you call invoke on a cache with configured CacheStore and > >> > > ExpiryPolicy, then chosen expiry depends on cache's atomicity mode= . > >> > > If cache is atomic, then "creation" expiry timeout is chosen, but = if > >> it > >> > is > >> > > transactional - then "access". > >> > > > >> > > I think, this behavior should at least be identical in both cases, > but > >> > > what is more important, it should conform to JCache specification. > >> > > But I wasn't able to find a clear statement regarding this questio= n > in > >> > the > >> > > specification. Can somebody point out a place in the specification > >> that > >> > > defines a behavior in such case? > >> > > > >> > > Cheers, > >> > > Denis > >> > > > >> > > >> > > > --001a113ed6be2d4ce405592f2f55--