Tanvi Penumudy created HDDS-13074:
-------------------------------------

             Summary: Prevent linked bucket creation when source volume and/or 
bucket is missing
                 Key: HDDS-13074
                 URL: https://issues.apache.org/jira/browse/HDDS-13074
             Project: Apache Ozone
          Issue Type: Bug
          Components: Ozone CLI
    Affects Versions: 2.0.0
            Reporter: Tanvi Penumudy
            Assignee: Tanvi Penumudy


Currently, we allow the creation of linked buckets even if the source volume 
and/or bucket is missing. This should be prevented, and an appropriate 
IOException must be thrown to indicate the missing source volume or bucket.

Current behaviour:
{code}
// source volume does not exist
bash-4.4$ ozone sh volume info vol2
VOLUME_NOT_FOUND Volume vol2 is not found

// link bucket creation succeeds
bash-4.4$ ozone sh bucket link vol2/buck1 vol1/buck2
bash-4.4$ ozone sh bucket info vol1/buck2
{
  "volumeName" : "vol1",
  "name" : "buck2",
  "sourceVolume" : "vol2",
  "sourceBucket" : "buck1",
  "creationTime" : "2025-05-19T16:01:36.891Z",
  "modificationTime" : "2025-05-19T16:01:36.891Z",
  "owner" : "hadoop",
  "link" : true
}

// create source volume
bash-4.4$ ozone sh volume create vol2

// source volume exists but source bucket does not exist
bash-4.4$ ozone sh bucket info vol2/buck1
BUCKET_NOT_FOUND Bucket not found: vol2/buck1

// link bucket creation succeeds
bash-4.4$ ozone sh bucket link vol2/buck1 vol1/buck3
bash-4.4$ ozone sh bucket info vol1/buck3
{
  "volumeName" : "vol1",
  "name" : "buck3",
  "sourceVolume" : "vol2",
  "sourceBucket" : "buck1",
  "creationTime" : "2025-05-19T16:03:18.932Z",
  "modificationTime" : "2025-05-19T16:03:18.932Z",
  "owner" : "hadoop",
  "link" : true
}
{code}
 



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