Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-4536 Allow CF to retain deleted rows
  3. HBASE-5523

Fix Delete Timerange logic for KEEP_DELETED_CELLS

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.94.0, 0.95.0
    • Component/s: regionserver
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      A Delete at time T marks a Put at time T as deleted.
      In parent I invented special logic that insert a virtual millisecond into the tr if the encountered KV is a delete marker.
      This was so that there is a way to specify a timerange that would allow to see the put but not the delete:

      if (kv.isDelete()) {
        if (!keepDeletedCells) {
          // first ignore delete markers if the scanner can do so, and the
          // range does not include the marker
          boolean includeDeleteMarker = seePastDeleteMarkers ?
          // +1, to allow a range between a delete and put of same TS
          tr.withinTimeRange(timestamp+1) :
          tr.withinOrAfterTimeRange(timestamp);
      

      Discussed this today with a coworker and he convinced me that this is very confusing and also not needed.
      When we have a Delete and Put at the same time T, there is not timerange that can include the Put but not the Delete.

      So I will change the code to this (and fix the tests):

      if (kv.isDelete()) {
        if (!keepDeletedCells) {
          // first ignore delete markers if the scanner can do so, and the
          // range does not include the marker
          boolean includeDeleteMarker = seePastDeleteMarkers ?
          tr.withinTimeRange(timestamp) :
          tr.withinOrAfterTimeRange(timestamp);
      

      It's easier to understand, and does not lead to strange scenarios when the TS is used as a controlled counter.

      Needs to be done before 0.94 goes out.

        Attachments

        1. 5523.txt
          3 kB
          Lars Hofhansl

          Activity

            People

            • Assignee:
              larsh Lars Hofhansl
              Reporter:
              larsh Lars Hofhansl

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment