Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 87F3B18876 for ; Wed, 2 Mar 2016 16:00:44 +0000 (UTC) Received: (qmail 73934 invoked by uid 500); 2 Mar 2016 16:00:44 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 73892 invoked by uid 500); 2 Mar 2016 16:00:44 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 73882 invoked by uid 99); 2 Mar 2016 16:00:44 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Mar 2016 16:00:44 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id ED91E1A1260 for ; Wed, 2 Mar 2016 16:00:43 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-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: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id l_m_C4gdYOXk for ; Wed, 2 Mar 2016 16:00:42 +0000 (UTC) Received: from mail-qk0-f173.google.com (mail-qk0-f173.google.com [209.85.220.173]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 07E0060CF0 for ; Wed, 2 Mar 2016 16:00:41 +0000 (UTC) Received: by mail-qk0-f173.google.com with SMTP id x1so83966290qkc.1 for ; Wed, 02 Mar 2016 08:00:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=AyfVIAgcnyas5dGzKY3B/LFeQqxjUYgaETCIKGh4vC8=; b=eK++adkJkHp9agqBJ/r0Dvbqsui43JC3FbpmiZack+tumPY5JyQyl4wT/jhlRcmMcI 2mWjVmwE0guyqNCa9MS+HZvRRkgXEcg3fKoCBaY+GjEawhxWDvwIKiOHIx8vk1Ggb0C5 4pAEyPFoeAYdnoAm0oPaub7lsJ/hSgzzAXxd9Y9M4EYzBk88PdGaV++HwAqCHiDBvT7e wQHWxPwA+E/rpUgkXjqNrAyLz42yhuMP6t1cMINe1fytP+Cs3rvBBtorx5vJD9pKVWKF thOR/+XSvoMeUlIKcxtDKKj9HhKDL+lkRzPnLBjIo9cgrzSJlcFgSN2xN7tahNgt4nVF pi8g== 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:date :message-id:subject:from:to; bh=AyfVIAgcnyas5dGzKY3B/LFeQqxjUYgaETCIKGh4vC8=; b=N+aWkM12NKGIBO6Tb4u9rm6Nuzdtxts1VNrEqB5Z72weLUCa4fEkWK76Oy+IqgGGto l4DFY82TR6UXCBjRf2e5wMgky/khvhGXJo5XsZGid+SGyijegZvmbRSClicBINynvcIc zFE2EJU2j2/K2JbHtFZcYJHtIRjVACf3BtcgmGZDkdw+OdpYlesppzPctgPGUn5yMnJO Vzm9Z4aWf7TrOGkgezF541i3z1D1r4QYsRHIUC2WAx/RBqkOhrs1UaQ8NmAPebQh6h/M /ZgQZ4BlISZLPogpVUwAVqOzXLkAvtanD7jcGxGpvmMnH7QBaneg3WCw5NTxzlVA73s4 9T3Q== X-Gm-Message-State: AD7BkJJJqQe29EDoxqancdRjKJlQOhv2RvNaoXUmeEgEgjLU9FES5PCf+s204Fxn6+4kKeDdwmfPfxhJazyreA== MIME-Version: 1.0 X-Received: by 10.55.82.137 with SMTP id g131mr33782968qkb.66.1456934137030; Wed, 02 Mar 2016 07:55:37 -0800 (PST) Received: by 10.140.97.246 with HTTP; Wed, 2 Mar 2016 07:55:36 -0800 (PST) In-Reply-To: References: Date: Wed, 2 Mar 2016 17:55:36 +0200 Message-ID: Subject: Re: Version issue with concurrent cache updates (EntryProcessor) From: Myron Chelyada To: user@ignite.apache.org Content-Type: multipart/alternative; boundary=001a114a87d4b2f2f7052d12e978 --001a114a87d4b2f2f7052d12e978 Content-Type: text/plain; charset=UTF-8 Alexey, Thanks for advice. But could you also provide any timelines for listed issues? 2016-03-02 1:14 GMT+02:00 Alexey Goncharuk : > Oh, I see now what you mean, IGNITE-1018 has escaped my view. Then, until > IGNITE-1018 is fixed, the only guaranteed approach is to wait on a CDL. > Here is the pseudo-code that I have in mind: > > LifecycleBean or after Ignition.start(): > // Populate your node local map > .... > > CountDownLatch init = nlm.get(INIT_KEY); > > if (init == null) { > CountDownLatch old = nlm.putIfAbsent(INIT_KEY, init = new CountDownLatch(1)); > > if (old != null) > init = old; > } > > init.countDown(); > > > EntryProcessor: > > CountDownLatch init = nlm.get(INIT_KEY); > > if (init == null) { > CountDownLatch old = nlm.putIfAbsent(INIT_KEY, init = new CountDownLatch(1)); > > if (old != null) > init = old; > } > > init.await(); > > // Run entry procesor > > > This approach has only one restriction - you should not call any cache operations on the started node before you release the latch, otherwise this may lead to a distributed deadlock. > > Hope this helps! > > AG > > --001a114a87d4b2f2f7052d12e978 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Alexey,

Thanks for advice.
But could you also provide any timelines for listed issues?


2016-03-02 1:14 GMT+02:00 Alexey Goncharuk <alexey.goncharuk@= gmail.com>:
Oh, I see now what you mean, IGNITE-1018 has escaped my view. Then, until= IGNITE-1018 is fixed, the only guaranteed approach is to wait on a CDL. He= re is the pseudo-code that I have in mind:

LifecycleBean= or after Ignition.start():
// Populate your node local map
=
....
CountDownLatch init =3D nlm.get(INIT_KEY);

if (init =3D=3D null) {
CountDownLatch ol= d =3D nlm.putIfAbsent(INIT_KEY, init =3D new CountDownLatch(1));

if (old !=3D null)
init =3D old;
}

init.countDown();

EntryProcessor:

CountDownLatch i=
nit =3D nlm.get(INIT_KEY);

if (init =3D=3D null) {
CountDownLatch old =3D nlm.putIfAbsent(INI= T_KEY, init =3D new CountDownLatch(1));

= if (old !=3D <= span style=3D"color:rgb(0,0,128);font-weight:bold">null
)
= init =3D old;
}

init.await();
// Run entry procesor

= = This approach has only one restriction - you should not call any cache oper= ations on the started node before you release the latch, otherwise this may= lead to a distributed deadlock.
Hope this helps!
AG

--001a114a87d4b2f2f7052d12e978--