Details

    • Sub-task
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • None
    • None
    • None

    Description

      (Excerpt from the design doc)

      We could show two sizes of a snapshot (terms borrowed from btrfs):

      a. Referenced size: total size of all the keys in the snapshot. This indicates how much space it would take on the target cluster when replicated. Basically this is du on the bucket inside the DB checkpoint. Use the existing counter (space used) implemented for quota.

      b. Exclusive size: the size of keys exclusively referenced by this snapshot. This indicates how much space (times replication factor) can be released from the cluster when the snapshot is deleted and garbage collected.

      The exclusive size calculation can be done with the help of deletedTable in the next snapshot (or active filesystem’s if it is the last snapshot). Iterate over next snapshot’s deletedTable (and delayedDeletedTable), count the number of keys that exist in the current snapshot, and return the sum of those key sizes.

      (ii) The exclusive size of a snapshot can fluctuate (typically increase) when a neighboring snapshot is deleted because of the deletedTable merge. Still, for a read-only snapshot, we can calculate this in a background thread and persist the size. And whenever a neighboring snapshot is deleted, the persisted value is invalidated and would have to be calculated again (possibly incrementally).

      Attachments

        1. Snapshot Size Calculation.pdf
          66 kB
          Aswin Shakil

        Issue Links

          Activity

            People

              aswinshakil Aswin Shakil
              smeng Siyao Meng
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: