You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2021/03/18 02:54:08 UTC

[GitHub] [skywalking] nisiyong opened a new issue #6572: hbase-1.x-plugin is not compatible with 2.x hbase-client

nisiyong opened a new issue #6572:
URL: https://github.com/apache/skywalking/issues/6572


   Please answer these questions before submitting your issue.
   
   - Why do you submit this issue?
   - [ ] Question or discussion
   - [ ] Bug
   - [ ] Requirement
   - [x] Feature or performance improvement
   
   ___
   ### Requirement or improvement
   
   #### Environment
   
   - **SkyWalking Agent**: 8.2.0
   - **HBase Client**: 2.1.0 (1.x works fine)
   
   #### Agent Log
   
   ```
   ERROR 2021-03-17 18:31:53:844 http-nio-8080-exec-4 InstMethodsInter : class[class org.apache.hadoop.hbase.client.HTable] before method[delete] intercept failure
   java.lang.IllegalStateException: Exit span doesn't include meaningful peer information.
   	at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:163)
   	at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:143)
   	at org.apache.skywalking.apm.agent.core.context.ContextManager.createExitSpan(ContextManager.java:126)
   	at org.apache.skywalking.apm.plugin.hbase.HTableInterceptor.beforeMethod(HTableInterceptor.java:72)
   	at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:76)
   	at org.apache.hadoop.hbase.client.HTable.delete(HTable.java)
   	at org.apache.skywalking.apm.testcase.hbase.controller.HBaseController.hbaseCase(HBaseController.java:91)
   ```
   
   ## 1.x HTable contructor (version 1.6.0, the latest 1.x)
   source code: [HTable.java](https://github.com/apache/hbase/blob/rel/1.6.0/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java)
   ```java
   @InterfaceAudience.Private
   public HTable(TableName tableName, final ClusterConnection connection,
       final ConnectionConfiguration tableConfig,
       final RpcRetryingCallerFactory rpcCallerFactory,
       final RpcControllerFactory rpcControllerFactory,
       final ExecutorService pool) throws IOException {
       ...
   }
   ```
   
   ## 2.x HTable contructor (version 2.0.0, the earliest 2.x)
   source code: [HTable.java](https://github.com/apache/hbase/blob/rel/2.0.0/hbase-client/src/main/java/org/apache/hadoop/hbase/client/HTable.java)
   ```java
   @InterfaceAudience.Private
   protected HTable(final ClusterConnection connection,
     final TableBuilderBase builder,
     final RpcRetryingCallerFactory rpcCallerFactory,
     final RpcControllerFactory rpcControllerFactory,
     final ExecutorService pool) {
     ...
   }
   ```
   
   The above difference cause `org.apache.skywalking.apm.plugin.hbase.HTableInterceptor#onConstruct` could not set the zk address in `EnhancedInstance`, and when invoke `ContextManager.createExitSpan` will pass the empty peer.
   ```java
   public void onConstruct(EnhancedInstance objInst, Object[] allArguments) throws Throwable {
       Configuration connection = ((ClusterConnection) allArguments[1]).getConfiguration();
       Field field = connection.getClass().getDeclaredField("overlay");
       field.setAccessible(true);
       Properties properties = (Properties) field.get(connection);
       for (Map.Entry entry : properties.entrySet()) {
           if ("hbase.zookeeper.quorum".equals(entry.getKey())) {
               objInst.setSkyWalkingDynamicField(entry.getValue().toString());
           }
       }
   }
   ```
   
   According to @wu-sheng 's suggestion in #6441, I am going to rename the plugin as `hbase-1.x-2.x-plugin`, and fix this promble. 
   


----------------------------------------------------------------
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] [skywalking] wu-sheng closed issue #6572: hbase-1.x-plugin is not compatible with 2.x hbase-client

Posted by GitBox <gi...@apache.org>.
wu-sheng closed issue #6572:
URL: https://github.com/apache/skywalking/issues/6572


   


-- 
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