You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tephra.apache.org by "Gokul Gunasekaran (JIRA)" <ji...@apache.org> on 2017/02/14 09:22:42 UTC
[jira] [Updated] (TEPHRA-208) Compaction removes rows incorrectly
for family deletes with column level conflict detection
[ https://issues.apache.org/jira/browse/TEPHRA-208?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Gokul Gunasekaran updated TEPHRA-208:
-------------------------------------
Fix Version/s: 0.11.0-incubating
> Compaction removes rows incorrectly for family deletes with column level conflict detection
> --------------------------------------------------------------------------------------------
>
> Key: TEPHRA-208
> URL: https://issues.apache.org/jira/browse/TEPHRA-208
> Project: Tephra
> Issue Type: Bug
> Affects Versions: 0.9.0-incubating
> Reporter: Thomas D'Silva
> Assignee: Thomas D'Silva
> Fix For: 0.11.0-incubating
>
> Attachments: TEPHRA-208.patch
>
>
> In DeleteTracker we only check the timestamp while removing cells during compaction. If the previous row had a family delete, cells from subsequent rows could also be compacted.
> The attached test fails without the following change
> {code}
> private static final class DeleteTracker {
> private long familyDeleteTs;
> + private byte[] rowKey;
>
> public static boolean isFamilyDelete(Cell cell) {
> return !TxUtils.isPreExistingVersion(cell.getTimestamp()) &&
> @@ -300,14 +301,17 @@ public class TransactionVisibilityFilter extends FilterBase {
>
> public void addFamilyDelete(Cell delete) {
> this.familyDeleteTs = delete.getTimestamp();
> + this.rowKey = Bytes.copy(delete.getRowArray(), delete.getRowOffset(), delete.getRowLength());
> }
>
> public boolean isDeleted(Cell cell) {
> - return cell.getTimestamp() <= familyDeleteTs;
> + return rowKey != null && Bytes.compareTo(cell.getRowArray(), cell.getRowOffset(),
> + cell.getRowLength(), rowKey, 0, rowKey.length) == 0 && cell.getTimestamp() <= familyDeleteTs;
> }
>
> public void reset() {
> this.familyDeleteTs = 0;
> + this.rowKey = null;
> }
> }
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)