ptlrs opened a new pull request, #7735:
URL: https://github.com/apache/ozone/pull/7735

   ## What changes were proposed in this pull request?
   Key names may include arbitrary number of `/` characters, such as 
`/volumename/bucketname/test1/test2`.
   
   The read-replicas command assumes key names will be single level or not 
include any `/` characters. This results in failures when the command is run on 
multilevel keys.
   
   This PR flattens the keynames by replacing `/` with `_`.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-12075
   Also see discussion in https://github.com/apache/ozone/pull/7693
   
   ## How was this patch tested?
   
   Manual testing:
   
   ```bash
   bash-5.1$ ozone debug --verbose read-replicas 
/ockrwvolume/ockrwbucket/test1/test2/1
   Volume Name : ockrwvolume
   Bucket Name : ockrwbucket
   Key Name : test1/test2/1
   Creating directory : ockrwvolume_ockrwbucket_test1_test2_1_20250122073427
   Successfully created!
   Writing : test1_test2_1_block1_ozone-datanode-1.ozone_default
   Writing manifest file : test1_test2_1_manifest
   
   bash-5.1$ cd ockrwvolume_ockrwbucket_test1_test2_1_20250122073427/
   
   bash-5.1$ ls -alht
   total 1.1M
   -rw-r--r--  1 hadoop hadoop  365 Jan 22 07:34 test1_test2_1_manifest
   drwxr-xr-x  4 hadoop hadoop  128 Jan 22 07:34 .
   -rw-r--r--  1 hadoop hadoop 1.0M Jan 22 07:34 
test1_test2_1_block1_ozone-datanode-1.ozone_default
   drwxr-xr-x 25 hadoop hadoop  800 Jan 22 07:34 ..
   
   bash-5.1$ cat test1_test2_1_manifest 
   {
     "filename" : "ockrwvolume/ockrwbucket/test1/test2/1",
     "datasize" : 1048576,
     "blocks" : [ {
       "blockIndex" : 1,
       "containerId" : 1,
       "localId" : 115816896921600001,
       "length" : 1048576,
       "offset" : 0,
       "replicas" : [ {
         "hostname" : "ozone-datanode-1.ozone_default",
         "uuid" : "5e14c3a9-2a94-490a-a34c-a657354c1198"
       } ]
     } ]
   ```
   
   CI: https://github.com/ptlrs/ozone/actions/runs/12903408829


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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to