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

The existing KeyValues in memstore are not removed completely after inserting cell into memStore

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.0.1, 1.1.0, 0.98.12, 2.0.0
    • None
    • None
    • Reviewed

    Description

      If I'm not wrong, the UPSERT method of memStore should remove all existing KeyValues except the newer version.

      In memStore,

      DefaultMemStore.java
      int versIionsVisible = 0;
      ...
      if (cur.getTypeByte() == KeyValue.Type.Put.getCode() &&
                  cur.getSequenceId() <= readpoint) {
                if (versionsVisible > 1) {
                  // if we get here we have seen at least one version visible to the oldest scanner,
                  // which means we can prove that no scanner will see this version
      
                  // false means there was a change, so give us the size.
                  long delta = heapSizeChange(cur, true);
                  addedSize -= delta;
                  this.size.addAndGet(-delta);
                  it.remove();
                  setOldestEditTimeToNow();
                } else {
                  versionsVisible++;
                }
      

      Does "versionsVisible > 1" should be changed to "versionsVisible >= 1" ?
      thanks.

      Attachments

        1. 12931-0.98.txt
          2 kB
          Ted Yu
        2. HBASE-12931.patch
          2 kB
          Chia-Ping Tsai

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: