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

   ## What changes were proposed in this pull request?
   
   Reject `rewriteKey` call at client if OM does not support it.
   
   https://issues.apache.org/jira/browse/HDDS-10865
   
   ## How was this patch tested?
   
   Created command `ozone sh key rewrite` to call the new API, toggling 
replication between RATIS/3 and EC/3,2.
   
   Tested the command in `ozone` environment to verify it works:
   
   ```
   $ cd hadoop-ozone/dist/target/ozone-1.5.0-SNAPSHOT/compose/ozone
   $ OZONE_DATANODES=5 ./run.sh -d
   $ docker-compose exec scm bash
   bash-4.2$ ozone freon ockg -n1 -t1 # create volume and bucket
   ...
   bash-4.2$ ozone sh key put /vol1/bucket1/rocksdbjni-7.7.3.jar 
share/ozone/lib/rocksdbjni-7.7.3.jar
   bash-4.2$ ozone sh key list /vol1/bucket1 -p=rocksdbjni-7.7.3.jar 
   [ {
     "creationTime" : "2024-05-16T18:33:10.860Z",
     "modificationTime" : "2024-05-16T18:33:12.277Z",
     "replicationConfig" : {
       "replicationFactor" : "THREE",
       "requiredNodes" : 3,
       "replicationType" : "RATIS"
     },
     ...
   } ]
   bash-4.2$ ozone sh key rewrite /vol1/bucket1/rocksdbjni-7.7.3.jar 
   bash-4.2$ ozone sh key list /vol1/bucket1 -p=rocksdbjni-7.7.3.jar 
   [ {
     "creationTime" : "2024-05-16T18:33:10.860Z",
     "modificationTime" : "2024-05-16T18:33:48.322Z",
     "replicationConfig" : {
       "data" : 3,
       "parity" : 2,
       "ecChunkSize" : 1048576,
       "codec" : "RS",
       "requiredNodes" : 5,
       "replicationType" : "EC"
     },
     ...
   } ]
   bash-4.2$ ozone sh key rewrite /vol1/bucket1/rocksdbjni-7.7.3.jar 
   bash-4.2$ ozone sh key list /vol1/bucket1 -p=rocksdbjni-7.7.3.jar 
   [ {
     "creationTime" : "2024-05-16T18:33:10.860Z",
     "modificationTime" : "2024-05-16T18:33:55.015Z",
     "replicationConfig" : {
       "replicationFactor" : "THREE",
       "requiredNodes" : 3,
       "replicationType" : "RATIS"
     },
     ...
   } ]
   ```
   
   Tested the command in `xcompat` environment with old cluster and new client 
to verify the change in this PR:
   
   ```
   $ cd hadoop-ozone/dist/target/ozone-1.5.0-SNAPSHOT/compose/xcompat
   $ OZONE_VERSION=1.4.0 COMPOSE_FILE=old-cluster.yaml:clients.yaml 
docker-compose up -d --scale datanode=5
   $ OZONE_VERSION=1.4.0 COMPOSE_FILE=old-cluster.yaml:clients.yaml 
docker-compose exec new_client bash
   bash-4.2$ ozone freon ockg -n1 -t1 # create volume and bucket
   ...
   bash-4.2$ ozone sh key put /vol1/bucket1/rocksdbjni-7.7.3.jar 
share/ozone/lib/rocksdbjni-7.7.3.jar
   bash-4.2$ ozone sh key rewrite /vol1/bucket1/rocksdbjni-7.7.3.jar 
   OzoneManager does not support atomic key rewrite.
   ```
   
   The new command is not part of the PR, but can be added if you think it's 
useful.
   
   CI:
   https://github.com/adoroszlai/ozone/actions/runs/9114412166


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