I'm using HBase 1.1.2, and trying to redeploy a custom endpoint coprocessor to fix an error in my Java code. I made some changes to the coprocessor code and redeployed it via the following steps:
- Rebuild the coprocessor jar
- Copy it to a location on the HDFS
- Remove the existing coprocessor:
alter 'table', METHOD => 'table_att_unset',NAME => 'coprocessor$1'
- Confirm through the HBase UI that the table has no coprocessors attached
- Add the new coprocessor by disabling the table and running
alter 'table', METHOD => 'table_att', 'coprocessor'=>'hdfs:///user/bwatson/sum-coprocessor-0.1.0-SNAPSHOT.jar|uk.co.hadoopathome.coprocessor.SumAndCountEndpoint||'
- Re-enable the table
- Confirm through the HBase UI that the coprocessor has been attached
When I re-run my client code that talks to the coprocessor, I can clearly see in the regionserver logs that the old coprocessor code is still running.
If I search for the jar locally on the regionserver that hosts my table, I see that the jar is only in one location:
find / -name "*um-coprocesso*"
/tmp/hbase-hbase/local/jars/tmp/.2107072457.sum-coprocessor-0.1.0-SNAPSHOT.jar.1522237762363.jar
/tmp/hbase-hbase/local/jars/tmp/..2107072457.sum-coprocessor-0.1.0-SNAPSHOT.jar.1522237762363.jar.crc
I can confirm from the date and size of this jar that it is the old version.
Is this a bug in HBase? How can I get around this?
you need to restart hbase server.
you cann't change coprocessor jar file when hbase is running. so you should restart hbase server after your step 6.
Restarting HBase did the trick; the jar in
/tmp/hbase-hbase/local/jars/tmp/
was removed, and my next deploy was successful.This is a bug in HBase, either in the documentation or the code. I'll raise a ticket with the HBase Jira.