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 次下载
62
0

资料内容

第 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

第 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

第 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

第 7 页

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

第 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

第 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

第 11 页

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

第 12 页

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

第 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

第 14 页

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

第 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

第 19 页

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

第 20 页

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

显示前 20 页。下载资料查看完整内容。

评论 (0)

登录 以加入讨论

暂无评论。快来抢沙发吧!