> because mappings generated by different nodes are supposed to be always
the same

Most file systems have atomic rename(). This means we should have two-phase
write of files into the folder in question. Step one - create
"NNNN.class.tmp" file, write data into it; Step two - rename file to
"NNNN.class". Catch "already used" exception and ignore it.

This way weird exceptions are avoided. Should I create a ticket about it?

-- 
Ilya Kasnacheev

2018-02-09 22:39 GMT+03:00 Valentin Kulichenko <
valentin.kuliche...@gmail.com>:

> Dmitry,
>
> I meant the persistence store itself, but just realized that we don't have
> a marshaller cache anymore, we use discovery messages instead. However, we
> still have the MarshallerMappingFileStore which is basically a persistence
> space created specifically for marshaller mappings. I think it would be a
> good idea to use something more generic for this (although this is not
> critical of course).
>
> In any case, my initial point was that using the same folder by different
> nodes for these mappings should not be an issue, because mappings generated
> by different nodes are supposed to be always the same. We just need to
> avoid weird exceptions.
>
> -Val
>
> On Fri, Feb 9, 2018 at 1:21 AM, Dmitry Pavlov <dpavlov....@gmail.com>
> wrote:
>
> > Hi Val,
> >
> > Do you mean by
> > > switching marshaller cache to persistence instead of using these files
> > makes perfect sense to me,
> > using 'metastore' for marshaller cache?
> >
> > Sincerely,
> > Dmitriy Pavlov
> >
> > пт, 9 февр. 2018 г. в 1:05, Valentin Kulichenko <
> > valentin.kuliche...@gmail.com>:
> >
> > > Sergey,
> > >
> > > These mappings are supposed to be the same on all nodes, so if the file
> > > already exists, we can safely ignore this, or use a lock to avoid
> > > concurrent access. Actually, I think we already fixed this in the past,
> > > it's weird that issue came up again.
> > >
> > > But in any case, switching marshaller cache to persistence instead of
> > using
> > > these files makes perfect sense to me, and we definitely should do
> that.
> > >
> > > -Val
> > >
> > > On Tue, Feb 6, 2018 at 1:04 AM, Sergey Chugunov <
> > sergey.chugu...@gmail.com
> > > >
> > > wrote:
> > >
> > > > Folks,
> > > >
> > > > There are several things here.
> > > >
> > > > Firstly user asked the initial question is sitting on Apache 1.x; it
> is
> > > > clear from exception stack trace he provided.
> > > > So although the issue exists for a while it looks like it doesn't
> hurt
> > > > users a lot.
> > > >
> > > > Secondly I examined the code managing marshaller mappings and can say
> > > that
> > > > it the issue is still here even in the latest version; thus I filed a
> > > > ticket [1] to address it.
> > > >
> > > > ​[1] https://issues.apache.org/jira/browse/IGNITE-7635
> > > >
> > > > Thanks,
> > > > Sergey.
> > > >
> > >
> >
>

Reply via email to