2020-04-08

Apr 8 In-Class Exercise Thread.

Post your solutions to the Apr 8 In-Class Exercise to this thread.
Best,
Chris
Post your solutions to the Apr 8 In-Class Exercise to this thread. Best, Chris

-- Apr 8 In-Class Exercise Thread
  not done yet
 <T1, X , 6, 8>
 - X not in disk
 <C0MMIT T1>
 <FLUSH LOG>
 <START DUMP>
 <START CKPT (T2)>
 <T2, Y, 10, 5 >
 <END CKPT>
 -X->archive
 -Y->archive
 <END DUMP>
(Edited: 2020-04-08)
not done yet <T1, X , 6, 8> - X not in disk <C0MMIT T1> <FLUSH LOG> <START DUMP> <START CKPT (T2)> <T2, Y, 10, 5 > <END CKPT> -X->archive -Y->archive <END DUMP>

-- Apr 8 In-Class Exercise Thread
maybe this?
 <T1, X, 6, 8>
 <COMMIT (T1)>
 <FLUSH LOG>
 <START DUMP> 
 <START CHECKPOINT (T2)>
 <T2, Y, 10, 5>
 <COMMIT (T2)>
 <FLUSH LOG>
 - db copies X=8 to disk
 - db copies Y=5 to disk
 <END CHECKPOINT>
 - X=8 is copied to archive
 - Y=5 is copied to archive
 <END DUMP> 
 - copy over log records from the <START DUMP> to the <END DUMP> to the archive
 - old logs in archive before the <START CHECKPOINT> are thrown away
(Edited: 2020-04-08)
maybe this? <T1, X, 6, 8> <COMMIT (T1)> <FLUSH LOG> <START DUMP> <START CHECKPOINT (T2)> <T2, Y, 10, 5> <COMMIT (T2)> <FLUSH LOG> - db copies X=8 to disk - db copies Y=5 to disk <END CHECKPOINT> - X=8 is copied to archive - Y=5 is copied to archive <END DUMP> - copy over log records from the <START DUMP> to the <END DUMP> to the archive - old logs in archive before the <START CHECKPOINT> are thrown away

-- Apr 8 In-Class Exercise Thread
 <T1, X, 6, 8>
 <T1, Commit>
 <T2, Y, 10, 5>
 *On disk: X = 6, Y = 10*
 <Start Dump>
 <Start Checkpoint (T2)>
 *Dirty buffers written to disk*
 *On disk: X = 8, Y = 5*
 <End Checkpoint (T2)>
 *database copies X as 8*
 *database copies Y as 5*
 <End Dump>
 
 
 *in archive X = 8, Y = 5*
 *log file before <Start T2> thrown out*
(Edited: 2020-04-08)
<T1, X, 6, 8> <T1, Commit> <T2, Y, 10, 5> *On disk: X = 6, Y = 10* <Start Dump> <Start Checkpoint (T2)> *Dirty buffers written to disk* *On disk: X = 8, Y = 5* <End Checkpoint (T2)> *database copies X as 8* *database copies Y as 5* <End Dump> *in archive X = 8, Y = 5* *log file before <Start T2> thrown out*

-- Apr 8 In-Class Exercise Thread
 <T1, X,6,8>
 <Commit T1>
 Memory X=8, Y=10
 <T2, Y, 10, 5>
 <START DUMP>  	
 <START CKPT>
 write to disk, disk x = 6, disk y = 10
 Memory Y = 5, X = 8
 Disk x = 6, y = 10
 <END CKPT>
 Archive Memory X = 8, Y= 10 
 <FLUSH LOG> 
 <END DUMP>
(Edited: 2020-04-08)
<T1, X,6,8> <Commit T1> Memory X=8, Y=10 <T2, Y, 10, 5> <START DUMP> <START CKPT> write to disk, disk x = 6, disk y = 10 Memory Y = 5, X = 8 Disk x = 6, y = 10 <END CKPT> Archive Memory X = 8, Y= 10 <FLUSH LOG> <END DUMP>

-- Apr 8 In-Class Exercise Thread
<T1, X, 6, 8>
<COMMIT T1>
The new value of X is not on disk
X=8 is in memory
<T2, Y, 10, 5>
<START DUMP>
<START CHECKPOINT T2>
T2 is not on disk or memory
<FLUSH LOG>
T1 is stored on disk as X=8
T2 could be in a dirty block so it might be in disk
<END CHECKPOINT T2>
X=8 & Y=5 are moved to the archive
<END DUMP>
Logs from start checkpoint until end dump are preserved in the archive
(Edited: 2020-04-08)
<T1, X, 6, 8> <COMMIT T1> The new value of X is not on disk X=8 is in memory <T2, Y, 10, 5> <START DUMP> <START CHECKPOINT T2> T2 is not on disk or memory <FLUSH LOG> T1 is stored on disk as X=8 T2 could be in a dirty block so it might be in disk <END CHECKPOINT T2> X=8 & Y=5 are moved to the archive <END DUMP> Logs from start checkpoint until end dump are preserved in the archive

-- Apr 8 In-Class Exercise Thread
<T1, X, 6, 8>
<COMMIT T1>
X = 8 in memory, X = 6 on disk still
<FLUSH LOGS>
<START DUMP>
<START CKPT T2>
<T2, Y, 10, 5>
<FLUSH LOGS>
<END CKPT T2>
<END DUMP>
T2 not committed so we lost it
(Edited: 2020-04-08)
<T1, X, 6, 8> <COMMIT T1> X = 8 in memory, X = 6 on disk still <FLUSH LOGS> <START DUMP> <START CKPT T2> <T2, Y, 10, 5> <FLUSH LOGS> <END CKPT T2> <END DUMP> T2 not committed so we lost it

-- Apr 8 In-Class Exercise Thread
<T1, X, 6, 8>
<COMMIT T1>
<START DUMP>
<T2, Y, 10, 5>
<FLUSH LOG>
<START CKPT (T2)>
<COMMIT T2>
<FLUSH LOG>
<END CKPT>
- X=8 is in memory and never on disk
- Y=5 is in memory and never on disk
- Archive <T1, X, 6, 8>
- Archive <T2, Y, 10, 5>
<END DUMP>
<T1, X, 6, 8> <COMMIT T1> <START DUMP> <T2, Y, 10, 5> <FLUSH LOG> <START CKPT (T2)> <COMMIT T2> <FLUSH LOG> <END CKPT> - X=8 is in memory and never on disk - Y=5 is in memory and never on disk - Archive <T1, X, 6, 8> - Archive <T2, Y, 10, 5> <END DUMP>

-- Apr 8 In-Class Exercise Thread
 <T1, X, 6, 8>
 <COMMIT (T1)>
 -X=8 in memory, X=6 on disk
 <FLUSH LOG>
 <T2, Y, 10, 5>
 <START DUMP>
 <START CHECKPOINT(T2)>
 <COMMIT (T2)>
 <FLUSH LOG>
 <END CHECKPOINT>
 -X=8 and Y=5 copied to archive
 <END DUMP>
 -old log records are dumped but logs between start checkpoint and end dump are preserved in the archive
<T1, X, 6, 8> <COMMIT (T1)> -X=8 in memory, X=6 on disk <FLUSH LOG> <T2, Y, 10, 5> <START DUMP> <START CHECKPOINT(T2)> <COMMIT (T2)> <FLUSH LOG> <END CHECKPOINT> -X=8 and Y=5 copied to archive <END DUMP> -old log records are dumped but logs between start checkpoint and end dump are preserved in the archive

-- Apr 8 In-Class Exercise Thread
<T1, X, 6, 8> <COMMIT T1> new value of X is not on disk X=8 is in memory <FLUSH LOG> <START DUMP> <START CHECKPOINT T2> <T2, Y, 10, 5> <COMMIT (T2)> <FLUSH LOG> copy value of X, Y to the archive <END CHECKPOINT T2> <END DUMP>
<T1, X, 6, 8> <COMMIT T1> new value of X is not on disk X=8 is in memory <FLUSH LOG> <START DUMP> <START CHECKPOINT T2> <T2, Y, 10, 5> <COMMIT (T2)> <FLUSH LOG> copy value of X, Y to the archive <END CHECKPOINT T2> <END DUMP>
[ Next ]
X