David Ribeiro Alves has uploaded a new change for review.

  http://gerrit.cloudera.org:8080/4929

Change subject: WIP: KUDU-237 (part 2) - Make DeltaStore::CheckRowDeleted() 
return an enum
......................................................................

WIP: KUDU-237 (part 2) - Make DeltaStore::CheckRowDeleted() return an enum

Previously this method would set a bool to true if a row was
deleted and left it unchanged if it wasn't. This is no longer enough
with reinserts.

For this particular case we go through the redo deltas in reverse
order, meaning we might find a reinsert in the last redo deltas. In
this case just not setting the bool is not enough, we need to be
able to tell the caller unequivocally that the row is alive.

This patch does this by introducing an enum: DeletionStatus. This
enum has three possible values: DELETED, if the last mutation we
found for the row was a DELETE; NOT_DELETED if the last mutation
we found for the row was a REINSERT; UNKNOWN if we didn't find
any mutation for the row.

This also adds a new visitor to DeltaFileIterator to set the new
enum and simplifies this path. We were previously using the same
path as when we apply deletes to a whole column going through the
updates in order. Not only is this not enough with reinserts when
traversing the redos in reverse order, but this path was also overly
complex. For instance it continuouly checked the validity of the
redo regarding the snapshot, which is not needed since we use an
"include all mutations" snapshhot in this case.

WIP as this needs a directed test.

Change-Id: Ia5680c0c719cc7d367ea870b2ccf61b81e5fb309
---
M src/kudu/common/row_changelist-test.cc
M src/kudu/tablet/delta_store.h
M src/kudu/tablet/delta_tracker.cc
M src/kudu/tablet/deltafile.cc
M src/kudu/tablet/deltafile.h
M src/kudu/tablet/deltamemstore.cc
M src/kudu/tablet/deltamemstore.h
7 files changed, 105 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/29/4929/1
-- 
To view, visit http://gerrit.cloudera.org:8080/4929
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5680c0c719cc7d367ea870b2ccf61b81e5fb309
Gerrit-PatchSet: 1
Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-Owner: David Ribeiro Alves <dral...@apache.org>

Reply via email to