Modern techniques for transaction- oriented database recovery - - PowerPoint PPT Presentation

modern techniques for transaction oriented database
SMART_READER_LITE
LIVE PREVIEW

Modern techniques for transaction- oriented database recovery - - PowerPoint PPT Presentation

Modern techniques for transaction- oriented database recovery Caetano Sauer My pleas 1.Demand on-demand recovery 2.Make the log great again Demand on-demand recovery ARIES Recovery info B A B A Transactions Pages requiring requiring


slide-1
SLIDE 1

Modern techniques for transaction-

  • riented database recovery

Caetano Sauer

slide-2
SLIDE 2
slide-3
SLIDE 3

My pleas

1.Demand on-demand recovery 2.Make the log great again

slide-4
SLIDE 4

Demand on-demand recovery

slide-5
SLIDE 5
  • 2. REDO scan

A B A B Buffer pool Database Pages requiring redo Transactions requiring undo

  • 3. UNDO scan
  • 1. Log analysis

ARIES

system mostly unavailable during three phases Recovery info LOG

slide-6
SLIDE 6

ARIES restart

6

Recovery info

  • 2. REDO scan

A B A B Buffer pool Database

  • 3. UNDO scan
  • 1. Log analysis

system mostly unavailable during three phases LOG

Pages requiring redo Transactions requiring undo

slide-7
SLIDE 7

Recovery info

Instant recovery

B Buffer pool fix(B) Aborting txn.

(pre-failure)

Running txn.

(post-failure)

lock(f) lock conflict!

same recovery actions, different schedule redo and undo on demand, without waiting for log scans

Pages requiring redo Transactions requiring undo + locks

...

LOG per-page log chains

slide-8
SLIDE 8

Failure classes

Failure class Loss Typical cause Response Transaction Single-transaction progress Deadlock, constraint violation Rollback System Server process (in-memory state) Software fault, power loss Restart Media Persistent database contents Hardware fault Restore Single page Local integrity Partial writes, wear-out Repair

slide-9
SLIDE 9

Make the log great again

slide-10
SLIDE 10

Log DB ?

Dual storage Single storage

Main memory Main memory “... a DBMS is really two DBMSs, one managing the database as we know it and a second one managing the log.”

Michael Stonebraker

write-

  • ptimized

read-

  • ptimized

Throw away the database!

slide-11
SLIDE 11

The log as a partitioned B-tree

P0 P1 P2 LSN domain

y z w

B A B A B A

x like an LSM, but with page identifiers and their log records

slide-12
SLIDE 12

The log as a partitioned B-tree (implementation)

P0 P1 P2 unsorted partition sorted partitions B A page → LSN mapping LSN domain

y z w

Partitioned log index log appends (txn. commit)

(sort low-water mark)

B A B A B A

u x

slide-13
SLIDE 13

Merging

Before:

B A B A B A z, w x, z

After:

B A B A z, w x, y y, z merge

slide-14
SLIDE 14

Log records Data structure fetch append Log index reorg. volatile persistent

FineLine:

WAL Log records Database Data structure write read volatile persistent append

Write-ahead logging:

FineLine

slide-15
SLIDE 15

FineLine recovery

Log records Data structure Indexed log volatile persistent

slide-16
SLIDE 16

fetch Indexed log volatile persistent

FineLine recovery

slide-17
SLIDE 17

fetch Indexed log volatile persistent

FineLine recovery

slide-18
SLIDE 18

fetch Indexed log volatile persistent

FineLine recovery

slide-19
SLIDE 19

➢ nodes recovered automatically during fetch ➢ volatile structures = in-memory database ➢ no undo, no dirty pages, no checkpoints, no offline log scans

fetch append Indexed log volatile persistent

FineLine

In-memory database

slide-20
SLIDE 20

In-memory databases Log-structured storage DBMS Buffer mgmt. Physiological logging

slide-21
SLIDE 21

My pleas

1.Demand on-demand recovery 2.Make the log great again

slide-22
SLIDE 22

Standing on the shoulders of Giants

slide-23
SLIDE 23

Thank you! csauer@tableau.com