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

Ewan Higgs commented on HDFS-11026:
-----------------------------------

{quote}
The non-deterministic decoding exception needs to resolved before integration.
{quote}
{quote}
I'm having trouble reproducing it.
{quote}

Upon further investigation I found that it was a timing issue rather than a 
difference between Oracle and Open JDK.

Because the {{expiryDate}} is first and the tests use {{Time.now()}} in 
generating the tokens, sometimes the {{expiryDate}} written by the protobuf 
happens to be parseable by the {{readFieldsLegacy}} function. Of course this is 
only an issue if we have a protobuf {{BlockTokenIdentifier}} and then we force 
it to be read by the old parser ({{readFieldsLegacy}}) - which we do not do.

An example {{BlockTokenIdentifier}} with expiryDate that will throw 
{{IOException}} is: {{2017-02-09 00:12:35,072+0100}}. In contrast, {{2017-02-09 
00:12:35,071+0100}} will raise {{java.lang.NegativeArraySizeException}}.

I'm adding a new test that demonstrates the different exceptions with crafted 
timestamps.

> Convert BlockTokenIdentifier to use Protobuf
> --------------------------------------------
>
>                 Key: HDFS-11026
>                 URL: https://issues.apache.org/jira/browse/HDFS-11026
>             Project: Hadoop HDFS
>          Issue Type: Task
>          Components: hdfs, hdfs-client
>    Affects Versions: 2.9.0, 3.0.0-alpha1
>            Reporter: Ewan Higgs
>            Assignee: Ewan Higgs
>             Fix For: 3.0.0-alpha3
>
>         Attachments: blocktokenidentifier-protobuf.patch, 
> HDFS-11026.002.patch, HDFS-11026.003.patch, HDFS-11026.004.patch, 
> HDFS-11026.005.patch, HDFS-11026.006.patch
>
>
> {{BlockTokenIdentifier}} currently uses a {{DataInput}}/{{DataOutput}} 
> (basically a {{byte[]}}) and manual serialization to get data into and out of 
> the encrypted buffer (in {{BlockKeyProto}}). Other TokenIdentifiers (e.g. 
> {{ContainerTokenIdentifier}}, {{AMRMTokenIdentifier}}) use Protobuf. The 
> {{BlockTokenIdenfitier}} should use Protobuf as well so it can be expanded 
> more easily and will be consistent with the rest of the system.
> NB: Release of this will require a version update since 2.8.x won't be able 
> to decipher {{BlockKeyProto.keyBytes}} from 2.8.y.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: hdfs-issues-unsubscr...@hadoop.apache.org
For additional commands, e-mail: hdfs-issues-h...@hadoop.apache.org

Reply via email to