Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-15201

SnapshotCounter hits MaxSnapshotID limit

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3.0
    • Component/s: snapshots
    • Labels:
      None

      Description

      Users reported that they are unable to take HDFS snapshots and their snapshotCounter hits MaxSnapshotID limit. MaxSnapshotID limit is 16777215.

      SnapshotManager.java
      
      private static final int SNAPSHOT_ID_BIT_WIDTH = 24;
      
      /**
       * Returns the maximum allowable snapshot ID based on the bit width of the
       * snapshot ID.
       *
       * @return maximum allowable snapshot ID.
       */
       public int getMaxSnapshotID() {
       return ((1 << SNAPSHOT_ID_BIT_WIDTH) - 1);
      }
      
      

       

      I think, SNAPSHOT_ID_BIT_WIDTH is too low. May be good idea to increase SNAPSHOT_ID_BIT_WIDTH to 31? to aline with our CURRENT_STATE_ID limit (Integer.MAX_VALUE - 1).

       

      /**
       * This id is used to indicate the current state (vs. snapshots)
       */
      public static final int CURRENT_STATE_ID = Integer.MAX_VALUE - 1;
      
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kpalanisamy Karthik Palanisamy
                Reporter:
                kpalanisamy Karthik Palanisamy
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: