You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2019/04/02 23:16:00 UTC
[jira] [Commented] (GEODE-6518) if the region's data policy is
empty, create jdbc-mapping will failed with NPE
[ https://issues.apache.org/jira/browse/GEODE-6518?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16808226#comment-16808226 ]
ASF subversion and git services commented on GEODE-6518:
--------------------------------------------------------
Commit 4e34b4a08b65c9d56f474d6a717dc9eda6633155 in geode's branch refs/heads/feature/GEODE-6518 from zhouxh
[ https://gitbox.apache.org/repos/asf?p=geode.git;h=4e34b4a ]
GEODE-6518: proxy region, should not add loader and writer for jdbc-mapping
but need to add AEQ-id to the region attributes
> if the region's data policy is empty, create jdbc-mapping will failed with NPE
> ------------------------------------------------------------------------------
>
> Key: GEODE-6518
> URL: https://issues.apache.org/jira/browse/GEODE-6518
> Project: Geode
> Issue Type: Bug
> Components: extensions, jdbc
> Reporter: xiaojian zhou
> Priority: Major
> Time Spent: 3h 10m
> Remaining Estimate: 0h
>
> {noformat}
> We never had a test case to create a region on one member with data, and on another member as accessor (i.e. data policy is empty). Then create a jdbc-mapping. This is a valid use case.
> Apply the following diff, it will modify the test case to test above scenario.
> diff --git a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
> index 06043f1657..ccb79b56c6 100644
> --- a/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
> +++ b/geode-connectors/src/distributedTest/java/org/apache/geode/connectors/jdbc/internal/cli/CreateMappingCommandDUnitTest.java
> @@ -119,7 +119,7 @@ public class CreateMappingCommandDUnitTest {
> server1 = startupRule.startServerVM(1, locator.getPort());
> server2 = startupRule.startServerVM(2, TEST_GROUP1, locator.getPort());
> server3 = startupRule.startServerVM(3, TEST_GROUP2, locator.getPort());
> - server4 = startupRule.startServerVM(4, TEST_GROUP1 + "," + TEST_GROUP2, locator.getPort());
> + server4 = startupRule.startServerVM(4, "Gester", locator.getPort());
> gfsh.connectAndVerify(locator);
> setupDatabase();
> @@ -196,10 +196,10 @@ public class CreateMappingCommandDUnitTest {
> .statusIsSuccess();
> }
> - private void setupGroupPartition(String regionName, String groupNames) {
> + private void setupGroupPartition(String regionName, String groupNames, boolean isAccessor) {
> gfsh.executeAndAssertThat(
> - "create region --name=" + regionName + " --type=PARTITION --groups=" + groupNames)
> - .statusIsSuccess();
> + "create region --name=" + regionName + (isAccessor ? " --type=PARTITION_PROXY"
> + : " --type=PARTITION") + " --groups=" + groupNames).statusIsSuccess();
> }
> private void setupAsyncEventQueue(String regionName) {
> @@ -346,7 +346,7 @@ public class CreateMappingCommandDUnitTest {
> @Test
> public void createMappingPartitionedUpdatesServiceAndClusterConfigForServerGroup() {
> String regionName = GROUP2_REGION;
> - setupGroupPartition(regionName, TEST_GROUP2);
> + setupGroupPartition(regionName, TEST_GROUP2, false);
> CommandStringBuilder csb = new CommandStringBuilder(CREATE_MAPPING);
> csb.addOption(REGION_NAME, regionName);
> csb.addOption(DATA_SOURCE_NAME, "connection");
> @@ -424,7 +424,8 @@ public class CreateMappingCommandDUnitTest {
> @Test
> public void createMappingPartitionedUpdatesServiceAndClusterConfigForMultiServerGroup() {
> String regionName = "/" + GROUP1_GROUP2_REGION;
> - setupGroupPartition(regionName, TEST_GROUP1 + "," + TEST_GROUP2);
> + setupGroupPartition(regionName, TEST_GROUP1, false);
> + setupGroupPartition(regionName, TEST_GROUP2, true);
> CommandStringBuilder csb = new CommandStringBuilder(CREATE_MAPPING);
> csb.addOption(REGION_NAME, regionName);
> csb.addOption(DATA_SOURCE_NAME, "connection");
> {noformat}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)