[ 
https://issues.apache.org/jira/browse/IGNITE-7264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16303297#comment-16303297
 ] 

Stanislav Lukyanov commented on IGNITE-7264:
--------------------------------------------

As said in the description, the root cause is that certain cache names are not 
compatible with persistence because there is no way to create a file (a 
directory) of that name. Slash leads to multiple directories being created, 
some other symbols ('\0' on Unix, '<', '*' and other on Windows) just can't be 
used, etc.

One way to handle that would be to check the name via `j.n.f.Paths.get()` 
(check that the name is accepted on this platform and that it is a simple 
name). However, I suspect that it might create more problems with portability 
accross different file systems and encodings (say, a cache name "my::cache" is 
valid on Unix but not on Windows).

Another way would be to disallow a large number of symbols/names on all 
platforms - that requires finding this set and, possibly, widening it later.

Finally, instead of disallowing a set of characters, it could be 
escaped/replaced in the file names (and left untouched in the cache names). For 
instance, replace all non-alphanumeric characters in a cache name with 
underscore, so that cache "foo/bar**foobar" has a persistence folder of name 
"cache-foo_bar__foobar".

> Caches with forward slash "/" in names cause problems for PDS
> -------------------------------------------------------------
>
>                 Key: IGNITE-7264
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7264
>             Project: Ignite
>          Issue Type: Bug
>          Components: cache, persistence
>    Affects Versions: 2.3
>            Reporter: Ilya Kasnacheev
>            Assignee: Stanislav Lukyanov
>
> If I am to create cache with name "caches/1", there's no immediate error, but 
> nodes fail when trying to rejoin topology with storage already initialized.
> I think there should be an immediate exception in case persistence is enabled 
> for such case.
> Moreover, I suggest first trying to create directory, then making sure it was 
> created and that dir.parent == expected parent directory. Because on Windows 
> there are more restrictions on FS file names, etc...



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to