Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18572

Delete can't remove the cells which have no visibility label

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 1.3.1, 1.2.6, 2.0.0-alpha-1
    • 1.4.0, 1.3.2, 2.0.0, 1.2.7
    • None
    • None
    • Reviewed

    Description

      DefaultVisibilityLabelServiceImpl.java
        @Override
        public boolean matchVisibility(List<Tag> putVisTags, Byte putTagsFormat, List<Tag> deleteVisTags,
            Byte deleteTagsFormat) throws IOException {
          if ((deleteTagsFormat != null && deleteTagsFormat == SORTED_ORDINAL_SERIALIZATION_FORMAT)
              && (putTagsFormat == null || putTagsFormat == SORTED_ORDINAL_SERIALIZATION_FORMAT)) {
            if (putVisTags.isEmpty()) {
              // Early out if there are no tags in the cell
              return false;
            }
            if (putTagsFormat == null) {
              return matchUnSortedVisibilityTags(putVisTags, deleteVisTags);
            } else {
              return matchOrdinalSortedVisibilityTags(putVisTags, deleteVisTags);
            }
          }
          throw new IOException("Unexpected tag format passed for comparison, deleteTagsFormat : "
              + deleteTagsFormat + ", putTagsFormat : " + putTagsFormat);
        }
      

      If the putVisTags is empty, it will return the false directly. Hence, the Delete#addColumn can't "see" the cell as well as deleting it. The Delete#addColumns, by contrast, doesn't invoke the cp#prePrepareTimeStampForDeleteVersion so it can remove the cell.

      Attachments

        1. HBASE-18572.branch-1.v0.patch
          15 kB
          Chia-Ping Tsai
        2. HBASE-18572.branch-1.v0.patch
          15 kB
          Chia-Ping Tsai
        3. HBASE-18572.branch-1.v0.patch
          15 kB
          Chia-Ping Tsai
        4. HBASE-18572.ut.patch
          3 kB
          Chia-Ping Tsai
        5. HBASE-18572.v0.patch
          4 kB
          Chia-Ping Tsai
        6. HBASE-18572.v0.patch
          4 kB
          Chia-Ping Tsai
        7. HBASE-18572.v1.patch
          16 kB
          Chia-Ping Tsai

        Issue Links

          Activity

            People

              chia7712 Chia-Ping Tsai
              chia7712 Chia-Ping Tsai
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: