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

SnapshotCounter hits MaxSnapshotID limit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.3.0
    • snapshots
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: