SlideShare a Scribd company logo
1 of 2
Download to read offline
CSEP 545 Transaction Processing for E-Commerce 1/25/2012
Assignment 4 1
Assignment 4
Read Chapter 7 of the textbook.
Problem 1
Consider a system that uses LSN-based operation logging with fuzzy checkpoints and
logging of undo’s, as described in the lecture slides and in Chapter 7 of the textbook.
Assume that there is no analysis pass before recovery (so there is no dirty page table in
the checkpoint record), and that CLR’s (i.e. undo records) are treated as normal updates
and do not splice out a portion of the log (as shown on lecture slide 33).
The following sequence of records is found in a database log after a system failure. Data
values, such as before and after images, are omitted. The notation P1/r1 means record r1
on page P1. We have five transactions T0-T4 and four database pages P0-P3.
LSN Trans Operation Type Page/Record Trans backpointer
21 T0 Update P0/r0 null
22 T1 Update P1/r1 null
23 T2 Update P2/r2 null
24 T2 Update P0/r3 23
25 T2 CLR P0/r3 24
26 T1 Update P0/r4 22
27 T0 Update P3/r5 21
28 checkpoint log record, Active transactions: [T0, 27], [T1, 26], [T2, 25]
29 T1 Commit
30 T3 Update P2/r6 null
31 T0 Update P0/r0 27
32 T2 CLR P2/r2 25
33 checkpoint log record, Active transactions: [T0, 31], [T2, 32], [T3, 30]
34 T2 End Abort
35 T3 Update P0/r3 30
36 T4 Update P2/r2 null
Answer each of the following. In each case, explain briefly why it’s the right answer.
a. Show the log records that must be written by the recovery process, in the proper
order, and briefly explain why they must be written. The new log records should have
LSNs numbered sequentially starting with 37.
b. What LSN is on each page after recovery completes?
c. Based on what you see in the log, what is the smallest LSN of any log record that
might have to be redone?
d. What pages are fetched from disk by the recovery process?
e. Does the log give you enough information to tell whether record-level or page-level
lock granularity is being used? If so, which is it and how can you tell? If not, explain
why not.
CSEP 545 Transaction Processing for E-Commerce 1/25/2012
Assignment 4 2
f. Would it have been legal for T2 to have written an End Abort record in between LSN
32 and 33? Why?
g. Suppose the system failed immediately after LSN 33, so that records 34 – 36 were not
written to the log. What log records would be written during recovery in order to
finish the abort of T2?
Now suppose we modify the example so that it uses an analysis pass. Each checkpoint
record now includes a dirty page table as follows:
 In LSN 28, Dirty page table = [P0:26, P1:22, P3:27]
 In LSN 33, Dirty page table = [P0:31, P2: 32]
h. Immediately after the second checkpoint is flushed, what LSNs could be on each
page on disk?
i. What would it mean if the dirty page table in LSN 33 did not have an entry for P2?

More Related Content

What's hot

Aggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream WindowsAggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream Windows
Paris Carbone
 
Real Time Data Processing at RTB House - Bartosz Łoś
Real Time Data Processing at RTB House - Bartosz ŁośReal Time Data Processing at RTB House - Bartosz Łoś
Real Time Data Processing at RTB House - Bartosz Łoś
Evention
 

What's hot (18)

Aries
AriesAries
Aries
 
Assignment#15
Assignment#15Assignment#15
Assignment#15
 
Aries
AriesAries
Aries
 
Aggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream WindowsAggregate Sharing for User-Define Data Stream Windows
Aggregate Sharing for User-Define Data Stream Windows
 
Aries
AriesAries
Aries
 
Recovery with concurrent transaction
Recovery with concurrent transactionRecovery with concurrent transaction
Recovery with concurrent transaction
 
Assignment#13
Assignment#13Assignment#13
Assignment#13
 
C++ 11 range-based for loop
C++ 11   range-based for loopC++ 11   range-based for loop
C++ 11 range-based for loop
 
Buffer management --database buffering
Buffer management --database buffering Buffer management --database buffering
Buffer management --database buffering
 
Registers in coa
Registers in coaRegisters in coa
Registers in coa
 
Why Spark for large scale data analysis
Why Spark for large scale data analysisWhy Spark for large scale data analysis
Why Spark for large scale data analysis
 
Procedure
ProcedureProcedure
Procedure
 
How we have grown 10x within 2 years
How we have grown 10x within 2 yearsHow we have grown 10x within 2 years
How we have grown 10x within 2 years
 
Csa stack
Csa stackCsa stack
Csa stack
 
Real-Time Data Processing at RTB House – Architecture & Lessons Learned
Real-Time Data Processing at RTB House – Architecture & Lessons LearnedReal-Time Data Processing at RTB House – Architecture & Lessons Learned
Real-Time Data Processing at RTB House – Architecture & Lessons Learned
 
Real Time Data Processing at RTB House - Bartosz Łoś
Real Time Data Processing at RTB House - Bartosz ŁośReal Time Data Processing at RTB House - Bartosz Łoś
Real Time Data Processing at RTB House - Bartosz Łoś
 
Stack c6
Stack c6Stack c6
Stack c6
 
Dynamo db and Cross Region Migration
Dynamo db and Cross Region MigrationDynamo db and Cross Region Migration
Dynamo db and Cross Region Migration
 

Similar to Assignment.4.2012

Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and Recovery
Damian T. Gordon
 
Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4
avniS
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency Control
J Singh
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
Bảo Hoang
 

Similar to Assignment.4.2012 (20)

Databases: Backup and Recovery
Databases: Backup and RecoveryDatabases: Backup and Recovery
Databases: Backup and Recovery
 
Assignment#14
Assignment#14Assignment#14
Assignment#14
 
Transaction unit 1 topic 4
Transaction unit 1 topic 4Transaction unit 1 topic 4
Transaction unit 1 topic 4
 
Relational Database Management System
Relational Database Management SystemRelational Database Management System
Relational Database Management System
 
CS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency ControlCS 542 -- Failure Recovery, Concurrency Control
CS 542 -- Failure Recovery, Concurrency Control
 
Database Systems Assignment Help
Database Systems Assignment HelpDatabase Systems Assignment Help
Database Systems Assignment Help
 
Computer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notesComputer Organization and 8085 microprocessor notes
Computer Organization and 8085 microprocessor notes
 
Unit 4 COA.pptx
Unit 4 COA.pptxUnit 4 COA.pptx
Unit 4 COA.pptx
 
Adbms 34 transaction processing and recovery
Adbms 34 transaction processing and recoveryAdbms 34 transaction processing and recovery
Adbms 34 transaction processing and recovery
 
Unit 07 dbms
Unit 07 dbmsUnit 07 dbms
Unit 07 dbms
 
lecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdflecture16-recap-questions-and-answers.pdf
lecture16-recap-questions-and-answers.pdf
 
Unit 06 dbms
Unit 06 dbmsUnit 06 dbms
Unit 06 dbms
 
CMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptxCMPN301-Pipelining_V2.pptx
CMPN301-Pipelining_V2.pptx
 
Chapter 4 the processor
Chapter 4 the processorChapter 4 the processor
Chapter 4 the processor
 
Unit iii
Unit iiiUnit iii
Unit iii
 
Pipelining And Vector Processing
Pipelining And Vector ProcessingPipelining And Vector Processing
Pipelining And Vector Processing
 
Chapter 04 the processor
Chapter 04   the processorChapter 04   the processor
Chapter 04 the processor
 
Concepts of Data Base Management Systems
Concepts of Data Base Management SystemsConcepts of Data Base Management Systems
Concepts of Data Base Management Systems
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
VTU 4TH SEM CSE COMPUTER ORGANIZATION SOLVED PAPERS OF JUNE-2013 JUNE-2014 & ...
 

More from ashish61_scs (20)

7 concurrency controltwo
7 concurrency controltwo7 concurrency controltwo
7 concurrency controltwo
 
Transactions
TransactionsTransactions
Transactions
 
22 levine
22 levine22 levine
22 levine
 
21 domino mohan-1
21 domino mohan-121 domino mohan-1
21 domino mohan-1
 
20 access paths
20 access paths20 access paths
20 access paths
 
19 structured files
19 structured files19 structured files
19 structured files
 
18 philbe replication stanford99
18 philbe replication stanford9918 philbe replication stanford99
18 philbe replication stanford99
 
17 wics99 harkey
17 wics99 harkey17 wics99 harkey
17 wics99 harkey
 
16 greg hope_com_wics
16 greg hope_com_wics16 greg hope_com_wics
16 greg hope_com_wics
 
15 bufferand records
15 bufferand records15 bufferand records
15 bufferand records
 
14 turing wics
14 turing wics14 turing wics
14 turing wics
 
14 scaleabilty wics
14 scaleabilty wics14 scaleabilty wics
14 scaleabilty wics
 
13 tm adv
13 tm adv13 tm adv
13 tm adv
 
11 tm
11 tm11 tm
11 tm
 
10b rm
10b rm10b rm
10b rm
 
10a log
10a log10a log
10a log
 
09 workflow
09 workflow09 workflow
09 workflow
 
08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick08 message and_queues_dieter_gawlick
08 message and_queues_dieter_gawlick
 
06 07 lock
06 07 lock06 07 lock
06 07 lock
 
05 tp mon_orbs
05 tp mon_orbs05 tp mon_orbs
05 tp mon_orbs
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 

Recently uploaded (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

Assignment.4.2012

  • 1. CSEP 545 Transaction Processing for E-Commerce 1/25/2012 Assignment 4 1 Assignment 4 Read Chapter 7 of the textbook. Problem 1 Consider a system that uses LSN-based operation logging with fuzzy checkpoints and logging of undo’s, as described in the lecture slides and in Chapter 7 of the textbook. Assume that there is no analysis pass before recovery (so there is no dirty page table in the checkpoint record), and that CLR’s (i.e. undo records) are treated as normal updates and do not splice out a portion of the log (as shown on lecture slide 33). The following sequence of records is found in a database log after a system failure. Data values, such as before and after images, are omitted. The notation P1/r1 means record r1 on page P1. We have five transactions T0-T4 and four database pages P0-P3. LSN Trans Operation Type Page/Record Trans backpointer 21 T0 Update P0/r0 null 22 T1 Update P1/r1 null 23 T2 Update P2/r2 null 24 T2 Update P0/r3 23 25 T2 CLR P0/r3 24 26 T1 Update P0/r4 22 27 T0 Update P3/r5 21 28 checkpoint log record, Active transactions: [T0, 27], [T1, 26], [T2, 25] 29 T1 Commit 30 T3 Update P2/r6 null 31 T0 Update P0/r0 27 32 T2 CLR P2/r2 25 33 checkpoint log record, Active transactions: [T0, 31], [T2, 32], [T3, 30] 34 T2 End Abort 35 T3 Update P0/r3 30 36 T4 Update P2/r2 null Answer each of the following. In each case, explain briefly why it’s the right answer. a. Show the log records that must be written by the recovery process, in the proper order, and briefly explain why they must be written. The new log records should have LSNs numbered sequentially starting with 37. b. What LSN is on each page after recovery completes? c. Based on what you see in the log, what is the smallest LSN of any log record that might have to be redone? d. What pages are fetched from disk by the recovery process? e. Does the log give you enough information to tell whether record-level or page-level lock granularity is being used? If so, which is it and how can you tell? If not, explain why not.
  • 2. CSEP 545 Transaction Processing for E-Commerce 1/25/2012 Assignment 4 2 f. Would it have been legal for T2 to have written an End Abort record in between LSN 32 and 33? Why? g. Suppose the system failed immediately after LSN 33, so that records 34 – 36 were not written to the log. What log records would be written during recovery in order to finish the abort of T2? Now suppose we modify the example so that it uses an analysis pass. Each checkpoint record now includes a dirty page table as follows:  In LSN 28, Dirty page table = [P0:26, P1:22, P3:27]  In LSN 33, Dirty page table = [P0:31, P2: 32] h. Immediately after the second checkpoint is flushed, what LSNs could be on each page on disk? i. What would it mean if the dirty page table in LSN 33 did not have an entry for P2?