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

ASF GitHub Bot commented on HDFS-17899:
---------------------------------------

JHSUYU opened a new pull request, #8499:
URL: https://github.com/apache/hadoop/pull/8499

   ### Description
   
   Follow up HDFS-17899 / HDFS-17897 by handling 
`InvalidEncryptionKeyException` in the remaining data-transfer connection setup 
paths:
   
   * DataXceiver `writeBlock` mirror pipeline connection
   * DataXceiver `replaceBlock` proxy copy connection
   * Erasure coding `StripedBlockWriter` target connection
   
   The exception is raised during SASL data-transfer handshake, before the 
downstream `writeBlock` / `copyBlock` request is sent. Retrying once is safe 
for these paths because no data-transfer operation has been issued yet. Before 
retrying, the socket is closed and the cached data encryption key is cleared so 
the next handshake obtains a fresh key. A second failure is propagated.
   
   ### Tests
   
   ```
   
JAVA_HOME=/Users/lizhenyu/Library/Java/JavaVirtualMachines/corretto-17.0.12/Contents/Home
 mvn -pl hadoop-hdfs-project/hadoop-hdfs -am 
-Dtest=TestDataXceiverEncryptionKey,TestStripedBlockWriterEncryptionKey,TestDataTransferEncryptionKey
 -DskipShade -DskipITs -Dspotbugs.skip -Denforcer.skip=true test
   ```




> Handle InvalidEncryptionKeyException in Balancer Dispatcher, SPS  
> BlockDispatcher and DataNode DataTransfer
> -----------------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-17899
>                 URL: https://issues.apache.org/jira/browse/HDFS-17899
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: balancer & mover, datanode, encryption
>    Affects Versions: 3.4.1
>            Reporter: ZhenyuLi
>            Assignee: ZhenyuLi
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 3.6.0
>
>
>   This is a follow-up of HDFS-17897.
>   HDFS-17897 fixed {{InvalidEncryptionKeyException}} handling in DFSClient 
> read/write and striped file checksum paths. However, three other
>   code paths that establish SASL-encrypted connections still lack this 
> handling:
>   {{Dispatcher.PendingMove.dispatch()}} — Balancer block moves
>   {{BlockDispatcher.moveBlock()}} — SPS block moves
>   {{DataNode.DataTransfer.run()}} — DataNode block replication
>   When {{dfs.encrypt.data.transfer=true}} and block keys rotate, these paths 
> are possible to fail with {{InvalidEncryptionKeyException}} and the stale key 
> stays cached, causing all subsequent transfers to fail until process restart.
>   Fix: Add the same retry pattern to all three paths — catch the exception,
>   clear the cached encryption key via a new {{clearDataEncryptionKey()}} 
> default
>    method on {{DataEncryptionKeyFactory}}, and retry once with a fresh key.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to