ankitjain64 commented on a change in pull request #2284:
URL: https://github.com/apache/hbase/pull/2284#discussion_r478709945



##########
File path: 
hbase-server/src/test/java/org/apache/hadoop/hbase/replication/TestMasterReplication.java
##########
@@ -441,6 +442,41 @@ public void testCyclicReplication3() throws Exception {
     }
   }
 
+  /**
+   * Tests that base replication peer configs are applied on peer creation
+   * and the is overriden if updated as part of updateReplicationPeerConfig()
+   *
+   */
+  @Test
+  public void testBasePeerConfigsAppliedOnPeerCreationAndUpdate()
+    throws Exception {
+    LOG.info("testBasePeerConfigsAppliedOnPeerCreation");
+    String customPeerConfigKey = "hbase.xxx.custom_config";
+    String customPeerConfigValue = "test";
+    String customPeerConfigUpdatedValue = "test_updated";
+    try {
+      
baseConfiguration.set(ReplicationPeerConfigUtil.HBASE_REPLICATION_PEER_BASE_CONFIG,
+        customPeerConfigKey.concat("=").concat(customPeerConfigValue));
+      startMiniClusters(2);
+      addPeer("1", 0, 1);
+      Admin admin = utilities[0].getAdmin();
+
+      Assert.assertEquals(customPeerConfigValue, 
admin.getReplicationPeerConfig("1").
+        getConfiguration().get(customPeerConfigKey));
+
+      ReplicationPeerConfig updatedReplicationPeerConfig = 
ReplicationPeerConfig.
+        newBuilder(admin.getReplicationPeerConfig("1")).
+        
putConfiguration(customPeerConfigKey,customPeerConfigUpdatedValue).build();
+      admin.updateReplicationPeerConfig("1", updatedReplicationPeerConfig);

Review comment:
       Looks like hbase does not provide the support for deleting a peer 
configuration, we can only update the value after a configuration is added. But 
I have added the test case for the scenario that new base config gets picked up 
after hbase restart.




----------------------------------------------------------------
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:
[email protected]


Reply via email to