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

SonixLegend commented on HBASE-13096:
-------------------------------------

I have reproduced that issue. When I used wal.encryption and phoenix secondary 
indexes, I got the same error message
2016-11-24 17:11:20,361 INFO  
[regionserver/host-172-31-0-68/172.31.0.68:16020.logRoller] wal.FSHLog: Rolled 
WAL 
/hbase/WALs/host-172-31-0-68,16020,1479976404182/host-172-31-0-68%2C16020%2C1479976404182.default.1479978679455
 with entries=0, filesize=242 B; new WAL 
/hbase/WALs/host-172-31-0-68,16020,1479976404182/host-172-31-0-68%2C16020%2C1479976404182.default.1479978680140
2016-11-24 17:11:20,363 INFO  
[regionserver/host-172-31-0-68/172.31.0.68:16020.logRoller] wal.FSHLog: 
Archiving 
hdfs://data/hbase/WALs/host-172-31-0-68,16020,1479976404182/host-172-31-0-68%2C16020%2C1479976404182.default.1479978679455
 to 
hdfs://data/hbase/oldWALs/host-172-31-0-68%2C16020%2C1479976404182.default.1479978679455
2016-11-24 17:11:20,654 WARN  
[regionserver/host-172-31-0-68/172.31.0.68:16020.append-pool1-t1] wal.FSHLog: 
Append sequenceId=9, requesting roll of WAL
java.lang.NullPointerException
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:801)
        at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:788)
        at org.apache.hadoop.hbase.KeyValue.getKeyLength(KeyValue.java:1324)
        at org.apache.hadoop.hbase.KeyValue.getTagsLength(KeyValue.java:1638)
        at 
org.apache.hadoop.hbase.regionserver.wal.SecureWALCellCodec$EncryptedKvEncoder.write(SecureWALCellCodec.java:199)
        at 
org.apache.hadoop.hbase.regionserver.wal.ProtobufLogWriter.append(ProtobufLogWriter.java:122)
        at 
org.apache.hadoop.hbase.regionserver.wal.FSHLog$RingBufferEventHandler.append(FSHLog.java:1932)
        at 
org.apache.hadoop.hbase.regionserver.wal.FSHLog$RingBufferEventHandler.onEvent(FSHLog.java:1794)
        at 
org.apache.hadoop.hbase.regionserver.wal.FSHLog$RingBufferEventHandler.onEvent(FSHLog.java:1704)
        at 
com.lmax.disruptor.BatchEventProcessor.run(BatchEventProcessor.java:128)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
2016-11-24 17:11:20,810 WARN  
[regionserver/host-172-31-0-68/172.31.0.68:16020.logRoller] wal.FSHLog: Failed 
sync-before-close but no outstanding appends; closing WAL: 
org.apache.hadoop.hbase.regionserver.wal.DamagedWALException: Append 
sequenceId=9, requesting roll of WAL
And my hbase-site.xml is containing the settings.
        <property>
                <name>hbase.regionserver.wal.encryption</name>
                <value>true</value>
        </property>

        <property>
                <name>hbase.regionserver.hlog.reader.impl</name>
                
<value>org.apache.hadoop.hbase.regionserver.wal.SecureProtobufLogReader</value>
        </property>

        <property>
                <name>hbase.regionserver.hlog.writer.impl</name>
                
<value>org.apache.hadoop.hbase.regionserver.wal.SecureProtobufLogWriter</value>
        </property>

        <property>
                <name>hbase.regionserver.wal.codec</name>
                
<value>org.apache.hadoop.hbase.regionserver.wal.IndexedWALEditCodec</value>
        </property>
And my phoenix table sql
CREATE SCHEMA TEST;
CREATE TABLE TEST.TEST (ID BIGINT NOT NULL PRIMARY KEY, TEST VARCHAR);
UPSERT INTO TEST.TEST (ID, TEST) VALUES (1, 'test');
CREATE INDEX TEST_INDEX ON TEST.TEST (TEST);

> NPE from SecureWALCellCodec$EncryptedKvEncoder#write when using WAL 
> encryption and Phoenix secondary indexes
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HBASE-13096
>                 URL: https://issues.apache.org/jira/browse/HBASE-13096
>             Project: HBase
>          Issue Type: Bug
>    Affects Versions: 0.98.6
>            Reporter: Andrew Purtell
>              Labels: phoenix
>
> On user@phoenix Dhavi Rami reported:
> {quote}
> I tried using phoenix in hBase with Transparent Encryption of Data At Rest 
> enabled ( AES encryption) 
> Works fine for a table with primary key column.
> But it doesn't work if I create Secondary index on that tables.I tried to dig 
> deep into the problem and found WAL file encryption throws exception when I 
> have Global Secondary Index created on my mutable table.
> Following is the error I was getting on one of the region server.
> {noformat}
> 2015-02-20 10:44:48,768 ERROR 
> org.apache.hadoop.hbase.regionserver.wal.FSHLog: UNEXPECTED
> java.lang.NullPointerException
>         at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:767)
>         at org.apache.hadoop.hbase.util.Bytes.toInt(Bytes.java:754)
>         at org.apache.hadoop.hbase.KeyValue.getKeyLength(KeyValue.java:1253)
>         at 
> org.apache.hadoop.hbase.regionserver.wal.SecureWALCellCodec$EncryptedKvEncoder.write(SecureWALCellCodec.java:194)
>         at 
> org.apache.hadoop.hbase.regionserver.wal.ProtobufLogWriter.append(ProtobufLogWriter.java:117)
>         at 
> org.apache.hadoop.hbase.regionserver.wal.FSHLog$AsyncWriter.run(FSHLog.java:1137)
>         at java.lang.Thread.run(Thread.java:745)
> 2015-02-20 10:44:48,776 INFO org.apache.hadoop.hbase.regionserver.wal.FSHLog: 
> regionserver60020-WAL.AsyncWriter exiting
> {noformat}
> I had to disable WAL encryption, and it started working fine with secondary 
> Index. So Hfile encryption works with secondary index but WAL encryption 
> doesn't work.
> {quote}
> Parking this here for later investigation. For now I'm going to assume this 
> is something in SecureWALCellCodec that needs looking at, but if it turns out 
> to be a Phoenix indexer issue I will move this JIRA there.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to