Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-2939 Ozone FS namespace
  3. HDDS-2682

OM File create request does not check for existing directory with the same name

    XMLWordPrintableJSON

Details

    Description

      Assume the following sequence of operations/requests:
      Req 1. create file -> /d1/d2/d3/d4/k1 (d3 implicitly is a sub-directory inside /d1/d2)
      Req 2. create file -> /d1/d2/d3 (d3 as a file inside /d1/d2)

      When processing request 2, OMFileCreateRequest needs to check if 'd1/d2/d3' is the name of an existing file or an existing directory. In which case the request has to fail.

      Currently for request 2, OM will check explicitly if there is a key '/d1/d2/d3' in the key table.
      Also for non-recursive create requests, OM will check if parent directory /d1/d2 already exists. For this, the OM iterates the key table to check if 'd1/d2' occurs as a prefix of any key in the key table - checkKeysUnderPath()

      What is missing in current behaviour?
      For OM File create, the table iterator must also determine if '/d1/d2/d3' exists as a prefix for any key in the key table - not just '/d1/d2'.

      This fix is required for the correctness of OzoneFS namespace. There is a potential performance impact - which is outside the scope of this jira and will be addressed separately.

      Attachments

        Issue Links

          Activity

            People

              rakeshr Rakesh Radhakrishnan
              sdeka Supratim Deka
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m