Skip to content
This repository has been archived by the owner on Sep 27, 2019. It is now read-only.

Fix for #1336 #1337

Merged
merged 2 commits into from
May 2, 2018
Merged

Fix for #1336 #1337

merged 2 commits into from
May 2, 2018

Conversation

pmenon
Copy link
Member

@pmenon pmenon commented May 1, 2018

It looks like the deletion logic in codegen was incomplete.

Problem: Under SI, as an optimization, the transaction manager doesn't update the last reader field when reading a version created by the current transaction. Then, in the version of TimestampOrderingTransactionManager::PerformDelete(...) that is called in codegen::Deleter, there is a sanity check to ensure that the transaction actually read the version. This will be false because of the aforementioned optimization.

Solution: There is an existing TimestampOrderingTransactionManager::PerformDelete(...) that doesn't require insertion of an empty version. This is the API we should be using in codgen::Deleter only in the case where we delete a version we've created. This is the same logic as in the interpreted engine.

@pmenon pmenon self-assigned this May 1, 2018
@coveralls
Copy link

coveralls commented May 1, 2018

Coverage Status

Coverage increased (+0.008%) to 77.454% when pulling bff435f on pmenon:fix-delete-1336 into d68ab71 on cmu-db:master.

@yingjunwu
Copy link
Contributor

hi @pmenon, I have reviewed your code and it looks great to me. The original codegen code for delete executor is incomplete: it only contains a simplified logic for deletion. Your code basically matches the logic in DeleteExecutor and checks both is_owner and is_written. I don't have any question on this part.

However, there are two questions.

  1. You mentioned that Under SI, as an optimization, the transaction manager doesn't update the last reader field when reading a version created by the current transaction. This is not precise, as this is not an optimization for SI. If the current transaction has already acquired the ownership of a tuple, then it must has already updated the last reader field of the tuple, hence there's no need to update it again. However, it seems that the codegen version of delete executor does not check the isolation level for a transaction, am I right? We also did not check the isolation level in codegen executor.

  2. Assertion fail when insert and delete in the same transaction #1336 mentioned that the test cases failed because of the codegen version of delete executor. It seems that when running test cases, we always set the codegen flag to true. If so, I wonder whether there's still need to maintain two versions of delete executor (the codegen version and the original version).

@pmenon
Copy link
Member Author

pmenon commented May 2, 2018

@yingjunwu Great. Do you see any any required changes? Other answers below:

  1. Yes, you're correct. The problem is that codegen::Deleter was not calling the correct PerformDelete() function. There seem to be two versions of the function: one when the txn is deleting a version written by itself, and one otherwise (both versions require the txn to own the version). Is this correct?
  2. Yes, there is duplication. The plan is to slowly phase out the executor stuff as we get more functionality into codegen. Hopefully this summer.

Copy link
Contributor

@yingjunwu yingjunwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed the code a second time and didn't see any necessity to change the code, as the logic is the same as the old non-codegen code.

@yingjunwu
Copy link
Contributor

@pmenon yes you are right. Regarding to the isolation levels, we don't want to check the isolation level in the codegen version of update/delete executor, right?

I think the PR is ready to go.

Copy link
Contributor

@poojanilangekar poojanilangekar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pmenon pmenon merged commit 7df6cb6 into cmu-db:master May 2, 2018
@pmenon pmenon deleted the fix-delete-1336 branch May 9, 2018 06:33
mtunique pushed a commit to mtunique/peloton that referenced this pull request Apr 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants