Return-Path: X-Original-To: apmail-ignite-dev-archive@minotaur.apache.org Delivered-To: apmail-ignite-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 790F9181CF for ; Tue, 16 Feb 2016 10:16:22 +0000 (UTC) Received: (qmail 97541 invoked by uid 500); 16 Feb 2016 10:16:22 -0000 Delivered-To: apmail-ignite-dev-archive@ignite.apache.org Received: (qmail 97499 invoked by uid 500); 16 Feb 2016 10:16:22 -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 97487 invoked by uid 99); 16 Feb 2016 10:16:22 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Feb 2016 10:16:22 +0000 Received: from mail-ob0-f179.google.com (mail-ob0-f179.google.com [209.85.214.179]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 0CCB51A0046 for ; Tue, 16 Feb 2016 10:16:22 +0000 (UTC) Received: by mail-ob0-f179.google.com with SMTP id xk3so250193667obc.2 for ; Tue, 16 Feb 2016 02:16:22 -0800 (PST) X-Gm-Message-State: AG10YOTUlbblSZKbWm5gbYsZOlCK3iki8AhIvy8dA1kxKJdwGR6ddUlaMXIr+Fw1MEBn2CDOvadPDoog76MMYCGl X-Received: by 10.182.153.10 with SMTP id vc10mr15976265obb.10.1455617781550; Tue, 16 Feb 2016 02:16:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.202.71.68 with HTTP; Tue, 16 Feb 2016 02:15:42 -0800 (PST) In-Reply-To: References: From: Dmitriy Setrakyan Date: Tue, 16 Feb 2016 02:15:42 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: NoopSwapSpaceSpi and dynamically started caches To: dev@ignite.apache.org Content-Type: multipart/alternative; boundary=089e013a0996cc709d052be06c26 --089e013a0996cc709d052be06c26 Content-Type: text/plain; charset=UTF-8 Sounds good to me. On Tue, Feb 16, 2016 at 2:13 AM, Yakov Zhdanov wrote: > Let's require that all nodes should have same swap space SPI. I think we > can put @GridSpiConsistencyChecked on file swap space SPI (any other > suggestions?). > > --Yakov > > 2016-02-15 23:31 GMT+03:00 Konstantin Margorin : > > > Probably I can handle this ticket, but I want to clarify one thing. > > > > Suppose dynamic cache with enabled swap should be partitioned between two > > nodes with backups=1. First node started with FileSwapSpaceSpi, second > with > > NoopSwapSpaceSpi. > > > > How cache should start in this case? > > > > > > On Mon, Feb 15, 2016 at 3:45 PM, Artem Shutak > > wrote: > > > > > I've created a newbie issue for that: > > > https://issues.apache.org/jira/browse/IGNITE-2650. > > > > > > -- Artem -- > > > > > > On Wed, Feb 10, 2016 at 8:53 PM, Dmitriy Setrakyan < > > dsetrakyan@apache.org> > > > wrote: > > > > > > > Artem, > > > > > > > > I like the option with proper exception in case if a dynamic cache is > > > > started with swap enabled while there was no swap configured in > Ignite. > > > > > > > > Starting FileSwapSpaceSpi all the time is not a good option as user > > will > > > > face the same problem when trying to change to a different SPI. > > > > > > > > D. > > > > > > > > On Wed, Feb 10, 2016 at 4:39 AM, Artem Shutak > > > > wrote: > > > > > > > > > Igniters, > > > > > > > > > > I've noticed an issue with NoopSwapSpaceSpi and dynamically started > > > > cashes. > > > > > > > > > > We have the following logic on node start: > > > > > > > > > > if (cfg.getSwapSpaceSpi() == null) { > > > > > boolean needSwap = false; > > > > > > > > > > if (cfg.getCacheConfiguration() != null && > > > > > !Boolean.TRUE.equals(cfg.isClientMode())) { > > > > > for (CacheConfiguration c : > > > > > cfg.getCacheConfiguration()) { > > > > > if (c.isSwapEnabled()) { > > > > > needSwap = true; > > > > > > > > > > break; > > > > > } > > > > > } > > > > > } > > > > > > > > > > cfg.setSwapSpaceSpi(needSwap ? new > > FileSwapSpaceSpi() : > > > > new > > > > > NoopSwapSpaceSpi()); > > > > > } > > > > > > > > > > According to the code above, if IgniteConfiguration doesn't contain > > > cache > > > > > configurations or all configured caches configured without swap, > then > > > > node > > > > > will be started with NoopSwapSpaceSpi. > > > > > As a result in this case, when we start dynamic cache with enabled > > swap > > > > > then actually swap doesn't work. > > > > > > > > > > There is simple workaround - user have to explicitly set > > > FileSwapSpaceSpi > > > > > to configuration. But now, there is no any warning or exception. > > > > > > > > > > What we can do: > > > > > > > > > > 1. Throw an exception on dynamic cache start (with swap enabled) > > > > > if NoopSwapSpaceSpi is configured. > > > > > 2. Actually, I don't see why we need NoopSwapSpaceSpi at all. I > > > think > > > > we > > > > > should configure FileSwapSpaceSpi always if user doesn't provide > > any > > > > > SwapSpaceSpi explicitly. > > > > > > > > > > Thoughts? > > > > > > > > > > Thanks, > > > > > -- Artem -- > > > > > > > > > > > > > > > --089e013a0996cc709d052be06c26--