What is the complementary operation of "ApplyDelete" in Project 4? #299
Unanswered
jaedongtang
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The complementary operation of
InsertisApplyDelete, but what is complementary operation ofApplyDelete? Is itInsert?Suppose the last operation of transaction is
Insert(inserted into slotrid_ain the log record). Then it starts to rollback andtransactionManager::Abortfunction would append aApplyDeleterecord (also withrid_a). Assume the the system crashes and theseInsertandApplyDeleteare the last logs written on disk.For the redo phase in recovery: if we perform
InsertandApplyDeletefor slotrid_a, then recordrid_awould be removed at the end. However, in the undo phase, how should we deal with the operationApplyDelete? This operation is "CLR" type and we should not undo it. But it seems the system does not support this type of log record. If we decide undo this operation ofApplyDeletebyInsertthe tuple, the problem isInsertdoes not guarantee insert it at exact slot positionrid_a(let us say it is inserted intorid_bnow) so we might not undo theInsertwithrid_afor the next step. How should we handle theApplyDeleteoperation?I also have another question about where should the log "ABORT" being appended? Should it being appended before any rollback logs (in the slides) or after rollback logs (in textbook and the codes in
TransactionManager::Abort)?Beta Was this translation helpful? Give feedback.
All reactions