geode-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Smith (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GEODE-716) Race in AttributesMutator.setCacheLoader on partitioned regions can result in buckets without a loader
Date Tue, 29 Dec 2015 18:34:49 GMT

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

Dan Smith commented on GEODE-716:
---------------------------------

It might be better to disallow using the AttributesMutator on a partition region. We don't
allow members to initially be configured inconsistently with different cache loaders. This
cache mutator opens a window where users can make their members have inconsistent cache loaders.

> Race in AttributesMutator.setCacheLoader on partitioned regions can result in buckets
without a loader
> ------------------------------------------------------------------------------------------------------
>
>                 Key: GEODE-716
>                 URL: https://issues.apache.org/jira/browse/GEODE-716
>             Project: Geode
>          Issue Type: Bug
>            Reporter: Dan Smith
>
> AttributesMutator.setCacheLoader ends up invoking this code in PartitionedRegionDataStore.cacheLoaderChanged.
> {code}
>     visitBuckets(new BucketVisitor() {
>       @Override
>       public void visit(Integer bucketId, Region r) {
>         AttributesMutator mut = r.getAttributesMutator();
>         if (logger.isDebugEnabled()) {
>           logger.debug("setting new cache loader in bucket region: {}", newLoader);
>         }
>         mut.setCacheLoader(newLoader);
>       }
>     });
> {code}
> However, that can miss buckets that are currently being created, because they read the
existing value for cache loader first, and then later are added to localBucket2RegionMap -
see PartitionedRegionDataStore.grabFreeBuckets.
> The net result is that some buckets can end up with null for the cache loader. If gets
a routed to those buckets, they will not invoke the cache loader. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message