You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Anton Vinogradov (JIRA)" <ji...@apache.org> on 2019/02/12 17:03:00 UTC

[jira] [Comment Edited] (IGNITE-11292) There is no way to disable WAL for cache in group

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

Anton Vinogradov edited comment on IGNITE-11292 at 2/12/19 5:02 PM:
--------------------------------------------------------------------

[~qvad]

Currently, it's only possible to enable/disable cache which is a cache group itself

 In case we want to support such cases we should think twice os it ok to change wal state for all caches inside group in case only one provided.
Also, is it ok to change wal state by group. How will we change the API?

 
Anyway,

Looks like we have to fix the following code to support the first case.
{noformat}
HashSet<String> grpCaches = new HashSet<>(grpDesc.caches().keySet());

grpCaches.removeAll(cacheNames);

if (!grpCaches.isEmpty()) {
   return errorFuture("Cannot change WAL mode because not all cache names belonging to the group are " +
"provided [group=" + grpDesc.groupName() + ", missingCaches=" + grpCaches + ']');
}
{noformat}
The second case can be supported by improving the following code to scan groups too
{noformat}
for (String cacheName : cacheNames) {
DynamicCacheDescriptor cacheDesc = cacheProcessor().cacheDescriptor(cacheName);

   if (cacheDesc == null)
      return errorFuture("Cache doesn't exist: " + cacheName);

   caches.put(cacheName, cacheDesc.deploymentId());

   CacheGroupDescriptor curGrpDesc = cacheDesc.groupDescriptor();
{noformat}

see org.apache.ignite.internal.processors.cache.WalStateManager#init for details.


was (Author: avinogradov):
[~qvad]

Currently, it's only possible to enable/disable cache which is a cache group itself

 In case we want to support such cases we should think twice os it ok to change wal state for all caches iтышву group in case only one provided.
Also, is it ok to change wal state by group. How will we change the API?

 
Anyway,

Looks like we have to fix the following code to support the first case.
{noformat}
HashSet<String> grpCaches = new HashSet<>(grpDesc.caches().keySet());

grpCaches.removeAll(cacheNames);

if (!grpCaches.isEmpty()) {
   return errorFuture("Cannot change WAL mode because not all cache names belonging to the group are " +
"provided [group=" + grpDesc.groupName() + ", missingCaches=" + grpCaches + ']');
}
{noformat}
The second case can be supported by improving the following code to scan groups too
{noformat}
for (String cacheName : cacheNames) {
DynamicCacheDescriptor cacheDesc = cacheProcessor().cacheDescriptor(cacheName);

   if (cacheDesc == null)
      return errorFuture("Cache doesn't exist: " + cacheName);

   caches.put(cacheName, cacheDesc.deploymentId());

   CacheGroupDescriptor curGrpDesc = cacheDesc.groupDescriptor();
{noformat}

see org.apache.ignite.internal.processors.cache.WalStateManager#init for details.

> There is no way to disable WAL for cache in group
> -------------------------------------------------
>
>                 Key: IGNITE-11292
>                 URL: https://issues.apache.org/jira/browse/IGNITE-11292
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Dmitry Sherstobitov
>            Priority: Critical
>
> Following code doesn't work if cache is in a cacheGroup:
> {code:java}
> ignite.cluster().disableWal(cacheName){code}
> cacheName == cacheName:
> {code:java}
> Caused by: class org.apache.ignite.IgniteCheckedException: Cannot change WAL mode because not all cache names belonging to the group are provided [group=cache_group_1, missingCaches=[cache_group_1_005, cache_group_3_063, cache_group_1_003, cache_group_3_064, cache_group_1_004, cache_group_3_061, cache_group_3_062, cache_group_1_001, cache_group_1_002]]
> {code}
> cacheName == groupName:
> {code:java}
> Caused by: class org.apache.ignite.IgniteCheckedException: Cache doesn't exist: cache_group_1{code}
> Also there is no javadoc about this behaviour



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)