0
votes

Is there any way to stop creation of tombstone markers while hard-deleting rows from hbase?

We have requirement to bulk delete millions of rows. Currently we follow following sequence of steps:

  1. Hard-delete data from hbase tables (using org.apache.hadoop.hbase.client.Delete API)
  2. Run major compaction on the impacted tables.
  3. Load new data into the tables.

As we have to perform major compaction, so currently we are forced to perform this activity during off-hours.

Is there any way to avoid creation of tombstone markers?

We found following link related to our problem on stackoverflow:

Is there a way to do hard delete (real delete) on HBase?

Thanks

Anuj

1
short answer - No. HFiles are immutable, so you cannot hard-delete data without creating new HFiles.shay__

1 Answers

0
votes

As shay__ stated, HFiles are immutable and you cannot hard delete records. But you dont have to major compact immediately after deletion. Add your rows with the same rowkey/cf/qualifier/value and timestamp newer than your Delete's timestamp. You can major compact your table in idle times or when required.