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 <ashu...@gridgain.com> 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 <dsetrak...@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 <ashu...@gridgain.com>
> > 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 --
> > >
> >
>

Reply via email to