You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/12/01 03:01:04 UTC

[GitHub] [geode] nabarunnag opened a new pull request #5790: GEODE-8748: Prevents NPE on alter expiry on proxy regions

nabarunnag opened a new pull request #5790:
URL: https://github.com/apache/geode/pull/5790


   	* When a region is created with zero local memory, there is no bucket regions created.
   	* When alter region is called on this proxy region to alter expiry, it tries to manipulate the bucket region.
   	* But there are no buckets and hence NPE is thrown.
   	* In this commit a null check is done before alter the bucket regions.
   	* Configs still need to changed to prevent restart issues.
   	* This similar to the check done in setEntryTimeToLive in PartitionedRegion class
   
   Thank you for submitting a contribution to Apache Geode.
   
   In order to streamline the review of the contribution we ask you
   to ensure the following steps have been taken:
   
   ### For all changes:
   - [ ] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message?
   
   - [ ] Has your PR been rebased against the latest commit within the target branch (typically `develop`)?
   
   - [ ] Is your initial contribution a single, squashed commit?
   
   - [ ] Does `gradlew build` run cleanly?
   
   - [ ] Have you written or updated unit tests to verify your changes?
   
   - [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
   
   ### Note:
   Please ensure that once the PR is submitted, check Concourse for build issues and
   submit an update to your PR as soon as possible. If you need help, please send an
   email to dev@geode.apache.org.
   


----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [geode] DonalEvans commented on a change in pull request #5790: GEODE-8748: Prevents NPE on alter expiry on proxy regions

Posted by GitBox <gi...@apache.org>.
DonalEvans commented on a change in pull request #5790:
URL: https://github.com/apache/geode/pull/5790#discussion_r533641921



##########
File path: geode-gfsh/src/distributedTest/java/org/apache/geode/management/internal/cli/commands/AlterTimeToLiveExpirationOnProxyRegionDUnitTest.java
##########
@@ -0,0 +1,74 @@
+/*
+ * 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.management.internal.cli.commands;
+
+import junitparams.JUnitParamsRunner;
+import junitparams.Parameters;
+import junitparams.naming.TestCaseName;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import org.junit.runner.RunWith;
+
+import org.apache.geode.test.dunit.rules.ClusterStartupRule;
+import org.apache.geode.test.dunit.rules.MemberVM;
+import org.apache.geode.test.junit.categories.EvictionTest;
+import org.apache.geode.test.junit.rules.GfshCommandRule;
+
+@Category({EvictionTest.class})
+@RunWith(JUnitParamsRunner.class)
+public class AlterTimeToLiveExpirationOnProxyRegionDUnitTest {
+  @Rule
+  public ClusterStartupRule clusterStartupRule = new ClusterStartupRule();
+  @Rule
+  public GfshCommandRule gfsh = new GfshCommandRule();
+
+  public Object[] getRegionTypePairs() {
+    return new Object[] {
+        new Object[] {"REPLICATE", "REPLICATE_PROXY"},
+        new Object[] {"PARTITION", "PARTITION_PROXY"},
+        new Object[] {"PARTITION_REDUNDANT", "PARTITION_PROXY_REDUNDANT"}
+    };
+  }
+
+  @Test
+  @Parameters(method = "getRegionTypePairs")
+  @TestCaseName("[{index}] {method} Non Proxy Region Type:{0}; Proxy Region Type:{1}")
+  public void whenExpirationIsSetUsingAlterOnProxyRegionThenItShouldNotThrowException(
+      String nonProxyRegionType, String proxyRegionType) throws Exception {
+    MemberVM locator = clusterStartupRule.startLocatorVM(0);
+    MemberVM server1 = clusterStartupRule.startServerVM(1, "non-proxy", locator.getPort());
+    MemberVM server2 = clusterStartupRule.startServerVM(2, "proxy", locator.getPort());

Review comment:
       These variables are assigned but never used.




----------------------------------------------------------------
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:
users@infra.apache.org



[GitHub] [geode] nabarunnag merged pull request #5790: GEODE-8748: Prevents NPE on alter expiry on proxy regions

Posted by GitBox <gi...@apache.org>.
nabarunnag merged pull request #5790:
URL: https://github.com/apache/geode/pull/5790


   


----------------------------------------------------------------
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:
users@infra.apache.org