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
-
The complementary operation of
Insert
isApplyDelete
, but what is complementary operation ofApplyDelete
? Is itInsert
?Suppose the last operation of transaction is
Insert
(inserted into slotrid_a
in the log record). Then it starts to rollback andtransactionManager::Abort
function would append aApplyDelete
record (also withrid_a
). Assume the the system crashes and theseInsert
andApplyDelete
are the last logs written on disk.For the redo phase in recovery: if we perform
Insert
andApplyDelete
for slotrid_a
, then recordrid_a
would 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 ofApplyDelete
byInsert
the tuple, the problem isInsert
does not guarantee insert it at exact slot positionrid_a
(let us say it is inserted intorid_b
now) so we might not undo theInsert
withrid_a
for the next step. How should we handle theApplyDelete
operation?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