Uploaded image for project: 'Apache Ozone'
  1. Apache Ozone
  2. HDDS-10770

[Hsync] Allow overwrite hsynced file

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.5.0
    • None

    Description

      Case1
      1. client1 open fileA with block1, write some data
      2. client2 open fileA with block2, write some data
      3. client1 close fileA
      4. client2 close fileA
      Expected result:
      fileA with block2 in keyTable // final fileA data is block2
      fileA with block1 in deletedKeyTable // block1 is deleted

      Case2
      1. client1 open fileA with block1, write some data
      2. client2 open fileA with block2, write some data, call hsync, close fileA
      3. client1 close fileA
      Expected result:
      fileA with block1 in keyTable // final fileA data is block1
      fileA with block2 in deletedKeyTable // block2 is deleted

      Case3:
      1. client1 open fileA with block1, write some data
      2. client2 open fileA with block2, write some data, call hsync
      3. client1 close fileA
      4. client2 close fileA
      Expected result:
      fileA with block1 in keyTable // final fileA data is block1
      client2 close fileA should fail
      fileA with block2 in deletedKeyTable // block2 is deleted

      Case4:
      1. client1 open fileA with block1, write some data, call hsync
      2. client2 open fileA with block2, write some data, call hsync
      3. client1 close fileA
      4. client2 close fileA
      Expected result:
      client1 close call will fail while client2 close will succeed.
      final fileA data is block2, block1 will be delted.

      The overall rule is
      a. the later commit overwrites early commit
      b. avoid mutual overwrites. Once a file is overwritten, it cannot later overwritten others again.
      To support this, when a hsynced file is overwritten, it will have "overwritten" metadata as a flag. All following allocate block, further hsync or commit of this file will fail.

      Attachments

        1. screenshot-1.png
          80 kB
          Sammi Chen

        Issue Links

          Activity

            People

              Sammi Sammi Chen
              Sammi Sammi Chen
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: