Failure recovery (15) (Khôi phục lỗi trong hệ thống tính toán dữ liệu chuyên sâu) (Tiếng Anh)

UN
Uni24h
0 downloads
62
0

Document content

Page 2

Integrity or correctness of data • Would like data to be “accurate” or “correct” at all times EMP Name Age White 52 Green 3421 Blue 1 2

Page 3

Integrity or consistency constraints • Predicates data must satisfy • Examples: - x is key of relation R - x → y holds in R (functional dependency) - Domain(x) = {Red, Blue, Green} - a is valid index for attribute x of R - no employee should make more than twice the average salary 3

Page 5

Constraints (as we use here) may not capture “full correctness” Example 1 Transaction constraints • When salary is updated, new salary > old salary • When account record is deleted, balance = 0 5

Page 7

Constraints (as we use here) may not capture “full correctness” Example 2 Database should reflect real world Reality DB 7

Page 8

in any case, continue with constraints... Observation: DB cannot be consistent always! Example: a1 + a2 +…. an = TOT (constraint) Deposit $100 in a2: a2  a2 + 100 TOT  TOT + 100 8

Page 9

Example: a1 + a2 +…. an = TOT (constraint) Deposit $100 in a2: a2  a2 + 100 TOT  TOT + 100 .. .. .. a2 50 150 150 .. .. .. TOT 1000 1000 1100 9

Page 11

Assumption: If T starts with DB in consistent state + T executes in isolation  T leaves DB in consistent state 11

Page 12

Correctness (informally) • If we stop running transactions, DB left consistent • Each transaction sees a consistent DB 12

Page 13

How can constraints be violated? • Transaction bug • DBMS bug • Hardware failure e.g., disk crash alters balance of account • Data sharing e.g.: T1: give 10% raise to programmers T2: change programmers  systems analysts 13

Page 14

How can we prevent/fix violations? • Due to failures only • Due to data sharing only • Due to failures and sharing 14

Page 15

Will not consider: • How to write correct transactions • How to write correct DBMS • Constraint checking & repair That is, solutions studied here do not need to know constraints 15

Page 19

Desired events: see product manuals…. Undesired expected events: System crash - memory lost - cpu halts, resets that’s it!! Undesired Unexpected: Everything else! 19

Page 20

Undesired Unexpected: Everything else! Examples: • Software bugs • Disk data is lost • Memory lost without CPU halt • CPU implodes wiping out universe…. 20

Showing the first 20 pages. Download the document to see it all.

Comments (0)

Sign in to join the discussion

No comments yet. Be the first!