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

Ted Yu commented on HBASE-19619:
--------------------------------

After adjusting for HBASE-19621, I got the following test failure:
{code}
Failure: 
^[[48;5;124;38;5;231;1mtest_update_peer_config:_can_update_peer_config_and_data(Hbase::ReplicationAdminTest)^[[0m
src/test/ruby/hbase/replication_admin_test.rb:541:in `block in 
test_update_peer_config:_can_update_peer_config_and_data'
     538:       peer_config = command(:get_peer_config, @peer_id)
     539:       print "removing peer @peer_id \n"
     540:       command(:remove_peer, @peer_id)
^[[48;5;124;38;5;231;1m  => 541:       assert_equal("new_value1", 
peer_config.get_configuration.get("config1"))^[[0m
     542:       assert_equal("value2", 
peer_config.get_configuration.get("config2"))
     543:       assert_equal("new_value1", 
Bytes.to_string(peer_config.get_peer_data.get(Bytes.toBytes("data1"))))
     544:       assert_equal("value2", 
Bytes.to_string(peer_config.get_peer_data.get(Bytes.toBytes("data2"))))
<^[[48;5;34;38;5;231;1m"new_value1"^[[0m> expected but was
<^[[48;5;124;38;5;231;1m"value1"^[[0m>
{code}
>From the following output, you can see that during builder.build call, the 
>value for config1 was changed twice:
{code}
updating new config
2017-12-26 04:11:16,590 DEBUG [main] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting new_value1 for config1
done updating new config
building config
2017-12-26 04:11:16,593 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      value2 for config2
2017-12-26 04:11:16,593 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      new_value1 for config1
2017-12-26 04:11:16,593 INFO  
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
master.HMaster(3388): Client=tyu//192.168.100.234 update replication peer 
config,     id=1, 
config=clusterKey=localhost:56800:/hbase,replicationEndpointImpl=org.apache.hadoop.hbase.replication.ReplicationEndpointForTest,replicateAllUserTables=true,bandwidth=0
2017-12-26 04:11:16,593 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      value2 for config2
2017-12-26 04:11:16,593 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      new_value1 for config1
2017-12-26 04:11:16,593 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      value2 for config2
2017-12-26 04:11:16,594 DEBUG 
[RpcServer.default.FPBQ.Fifo.handler=29,queue=2,port=60207] 
replication.ReplicationPeerConfig$ReplicationPeerConfigBuilderImpl(271): 
putting      value1 for config1
2017-12-26 04:11:16,594 DEBUG [main-EventThread] zookeeper.ZKWatcher(460): 
master:60207-0x16092bbba910000, quorum=localhost:56800, baseZNode=/hbase 
Received ZooKeeper Event,   type=NodeDataChanged, state=SyncConnected, 
path=/hbase/replication/peers/1
done building config
{code}
[~zghaobac]:
Can you review the patch ?

> Modify replication_admin.rb to use ReplicationPeerConfigBuilder
> ---------------------------------------------------------------
>
>                 Key: HBASE-19619
>                 URL: https://issues.apache.org/jira/browse/HBASE-19619
>             Project: HBase
>          Issue Type: Bug
>            Reporter: Ted Yu
>            Assignee: Ted Yu
>            Priority: Critical
>             Fix For: 2.0.0-beta-1
>
>         Attachments: 19619.v1.txt, 19619.v2.txt, 19619.v3.txt, 19619.v4.txt, 
> 19619.v5.txt
>
>
> Here is the error:
> {code}
> Error: 
> test_append_peer_namespaces:_works_with_namespaces_array(Hbase::ReplicationAdminTest):
>  Java::JavaLang::UnsupportedOperationException:
> java.util.Collections$UnmodifiableCollection.add(java/util/Collections.java:1055)
> java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
> org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:453)
> org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:314)
> RUBY.block in 
> add_peer_namespaces(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/hbase/replication_admin.rb:226)
> org.jruby.RubyArray.each(org/jruby/RubyArray.java:1734)
> org.jruby.RubyArray$INVOKER$i$0$0$each.call(org/jruby/RubyArray$INVOKER$i$0$0$each.gen)
> RUBY.add_peer_namespaces(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/hbase/replication_admin.rb:225)
> RUBY.command(/home/jenkins/jenkins-slave/workspace/HBase-Flaky-Tests/hbase-shell/src/main/ruby/shell/commands/append_peer_namespaces.rb:40)
> org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:522)
> {code}
> The cause was due to adding to UnmodifiableCollection



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to