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

ASF GitHub Bot commented on GEODE-8894:
---------------------------------------

ringles commented on a change in pull request #5978:
URL: https://github.com/apache/geode/pull/5978#discussion_r570404606



##########
File path: 
geode-core/src/main/java/org/apache/geode/internal/cache/EntryEventImpl.java
##########
@@ -165,6 +165,9 @@
    */
   private byte[] deltaBytes = null;
 
+  /** If true, causes deltas to trigger recalculation of bucket size **/
+  private boolean forceRecalculateSize = false;

Review comment:
       Sorted out; looks like when I attempted this once I grabbed the wrong 
delta value at one point. Anyway, it works now without the member variable.

##########
File path: 
geode-core/src/distributedTest/java/org/apache/geode/internal/cache/DeltaForceSizingFlagDUnitTest.java
##########
@@ -0,0 +1,995 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more 
contributor license
+ * agreements. See the NOTICE file distributed with this work for additional 
information regarding
+ * copyright ownership. The ASF licenses this file to You under the Apache 
License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance with the 
License. You may obtain a
+ * copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software 
distributed under the License
+ * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 
KIND, either express
+ * or implied. See the License for the specific language governing permissions 
and limitations under
+ * the License.
+ */
+package org.apache.geode.internal.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.DataInput;
+import java.io.DataOutput;
+import java.io.File;
+import java.io.IOException;
+import java.util.Random;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.Test;
+
+import org.apache.geode.DataSerializable;
+import org.apache.geode.DataSerializer;
+import org.apache.geode.cache.AttributesFactory;
+import org.apache.geode.cache.Cache;
+import org.apache.geode.cache.DataPolicy;
+import org.apache.geode.cache.EntryEvent;
+import org.apache.geode.cache.EvictionAction;
+import org.apache.geode.cache.EvictionAttributes;
+import org.apache.geode.cache.InterestPolicy;
+import org.apache.geode.cache.PartitionAttributes;
+import org.apache.geode.cache.PartitionAttributesFactory;
+import org.apache.geode.cache.Region;
+import org.apache.geode.cache.Scope;
+import org.apache.geode.cache.SubscriptionAttributes;
+import org.apache.geode.cache.control.ResourceManager;
+import org.apache.geode.cache.partition.PartitionRegionHelper;
+import org.apache.geode.cache.util.CacheListenerAdapter;
+import org.apache.geode.cache.util.ObjectSizer;
+import org.apache.geode.distributed.DistributedMember;
+import org.apache.geode.distributed.internal.InternalDistributedSystem;
+import org.apache.geode.test.dunit.Assert;
+import org.apache.geode.test.dunit.VM;
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+
+/**
+ * Tests the use of the per-delta "forceRecalculateSize" flag.
+ */
+
+public class DeltaForceSizingFlagDUnitTest {

Review comment:
       The parameterization makes it hard to run individual tests, and with the 
number of tests significantly reduced, the benefit of this would be marginal. 
If we have to add more tests, though, I'll keep it in mind.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Allow individual deltas to trigger bucket size recalculation
> ------------------------------------------------------------
>
>                 Key: GEODE-8894
>                 URL: https://issues.apache.org/jira/browse/GEODE-8894
>             Project: Geode
>          Issue Type: New Feature
>          Components: core, serialization
>    Affects Versions: 1.14.0
>            Reporter: Raymond Ingles
>            Priority: Major
>              Labels: pull-request-available
>
> The Redis subsystem uses Deltas heavily, but by default deltas do not trigger 
> an update to the size of their buckets. This leads to incorrect memory usage 
> accounting over the long term, especially with the use of Redis commands like 
> "APPEND".
> It is possible to set the system property "DELTAS_RECALCULATE_SIZE", but this 
> is a global value that would affect the processing of all deltas, including 
> non-Redis operations.
> Instead, we will add a new default method to the Delta interface, that can be 
> overridden by individual Delta implementations (such as Redis). This will 
> trigger the same behavior as DELTAS_RECALCULATE_SIZE, but on a per-delta 
> basis. Thus, other Geode operations will not force bucket size recalculations 
> unless the global property is set, but Redis statistics will be correct.
> Other types of delta operations may find this useful in the future.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to