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

Pending delete blocks are not always included in #BLOCKCOUNT metadata

    XMLWordPrintableJSON

Details

    Description

      Within the code that handles containers, there is currently some disagreement as to whether blocks marked for deletion with the #deleting# prefix should be included in the #BLOCKCOUNT metadata value. The BlockDeletingService includes pending delete blocks in the block count, since after deleting the blocks, BlockDeletingService#call calls KeyValueContainerData#updateAndCommitDBCounters, where the pending deletion blocks (now deleted) are subtracted from the block count metadata. However, KeyValueContainerUtil#initializeUsedBytesAndBlockCount filters away all blocks that have prefixes when setting the block count. This means pending delete blocks with the #deleting# prefix are excluded from the block count.

      This fix will alter KeyValueContainerUtil#initializeUsedBytesAndBlockCount to include #deleting# blocks when setting the #BLOCKCOUNT and #BYTESUSED metadata values. It will also adjust the TestContainerReader unit tests to account for this change.

      Attachments

        Issue Links

          Activity

            People

              erose Ethan Rose
              erose Ethan Rose
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: