MCPcopy Create free account
hub / github.com/1345414527/MIT6.830 / logAbort

Method logAbort

src/java/simpledb/storage/LogFile.java:149–172  ·  view source on GitHub ↗

Write an abort record to the log for the specified tid, force the log to disk, and perform a rollback @param tid The aborting transaction.

(TransactionId tid)

Source from the content-addressed store, hash-verified

147 @param tid The aborting transaction.
148 */
149 public void logAbort(TransactionId tid) throws IOException {
150 // must have buffer pool lock before proceeding, since this
151 // calls rollback
152
153 synchronized (Database.getBufferPool()) {
154
155 synchronized(this) {
156 preAppend();
157 //Debug.log("ABORT");
158 //should we verify that this is a live transaction?
159
160 // must do this here, since rollback only works for
161 // live transactions (needs tidToFirstLogRecord)
162 rollback(tid);
163
164 raf.writeInt(ABORT_RECORD);
165 raf.writeLong(tid.getId());
166 raf.writeLong(currentOffset);
167 currentOffset = raf.getFilePointer();
168 force();
169 tidToFirstLogRecord.remove(tid.getId());
170 }
171 }
172 }
173
174 /** Write a commit record to disk for the specified tid,
175 and force the log to disk.

Callers 2

abortMethod · 0.80
transactionCompleteMethod · 0.80

Calls 6

getBufferPoolMethod · 0.95
preAppendMethod · 0.95
rollbackMethod · 0.95
forceMethod · 0.95
getIdMethod · 0.65
removeMethod · 0.45

Tested by 1

abortMethod · 0.64