DOC PREVIEW
UW CSE 444 - Introduction to Database Systems

This preview shows page 1-2-3-4-5-6 out of 17 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 17 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Introduction to Database Systems CSE 444 Lecture 26: Distributed TransactionsAnnouncements  Wrap%u p'l ecture'on'Friday' Short'review'+'example'problems'on'the'board' Project'4'due'this'Friday' Don’t'forget'to'terminate'your'jobs!!!' Course'evaluaDons'at'the'end'of'this'lecture' Today:'Distributed'transacDons' Because'you'loved'transacDons'so'much'the'first'Dme'2Partitioned data TID$eid$name$city$age$salary$t1'53666'Jones'Madras'28'35k't2'53688'Smith'Chicago'38'32k't3'53650'Smith'Chicago'29'48k't4'53831'Madayan'Bombay'41'20k't5'53832'Guldu'Bombay'32'20k'eid$name$city$age$salary$53666'Jones'Madras'28'35k'53688'Smith'Chicago'38'32k'53650'Smith'Chicago'29'48k'53831'Madayan'Bombay'41'20k'53832'Guldu'Bombay'32'20k'Horizontal'Fragment'VerDcal'Fragment'Employee'3Distributed Data UPDATE' 'Employee'SET ' 'salary=salary+2k'WHERE 'age>30'4Distributed Catalog 5  How'do'we'idenDfy'a'relaDon?' Naming'issues:'' local%name%+%birth%site%=%global&rela)on&name& +replica_id%=%global&replica&name& Centralized'catalog' Vulnerable'to'single%site'failure' Compromizes'site'autonomy' R*'approach:' Local'catalog'describing'all'local'relaDons' Birth'site'also'keeps'track'of'replicas'and'fragments' Could'be'cached'at'other'sites'Remember Transactions? 6  ACID' Distributed'Concurrency'Control' How'can'locks'for'objects'be'managed?' How'can'deadlocks'be'detected?' Distributed'Recovery' Atomicity'and'Durability'need'to'be'enforced'across'sites' In'a'distributed'secng,'a'Xact'spawns'subtransacDons'Distributed Lock management 7  Centralized' one'site'deals'with'lock'and'unlock'requests' Primary'Copy' One'copy'of'an'object'is'designated'as'primary,'and'requests'are'handled'at'that'site' Fully'Distributed' Manage'requests'locally'Deadlock detection 8  Local'and'global'waits%for'graphs' 3'algorithms:'1. Construct'global'waits%for'graph'periodically'at'a'centralized'site'2. Construct'waits%for'graphs'hierarchically'3. Abort'long'waiDng'transacDons' Phantom'Deadlocks!'T1' T2'At'site'A'T1' T2'At'site'B'T1' T2'Global'waits%for'graph'Distributed Recovery 9  Either'all'subtransacDons'must'commit'or'none'of'them' Regular'logging'+'commit'pro tocol' The'transacDo n'manager'at'the'originaDng'site'is'the'coordinator' The'transacDo n'managers'at'the'subtransacDons’'sites'are'the'subordinates'2 Phase Commit: Motivation 10 subordinate'1'subordinate'2'subordinate'3'1.'User'decides'to'commit' 2.'commit'3.'commit'4.'coordinator'crash!'But'I'already'aborted''coor dinator'2 Phase Commit 11  Use'2'phases:'a'voDng'phase'and'a'terminaDon'phase' Principle:' When'a'process'makes'a'decision,'it'votes'yes/no'or'commit/abort' A'subordinate'acknowledges'messages'(acks)' Force%write'log'record'before'sending' Log'records'include'Xact'and'coordinator'ids' Coordinator'logs'ids'of'subordinates'2 Phase Commit: Phase 1 12 coor dinator'subordinate'1'subordinate'2'subordinate'3'1.'User'decides'to'commit' 2.'prepare'2.'prepare'2.'prepare'3.'force%write'prepare'3.'force%write'prepare'3.'force%write'prepare'4.'yes'4.'yes'4.'yes'2 Phase Commit: Phase 2 13 coor dinator'subordinate'1'subordinate'2'subordinate'3'1.'Force%write'commit' 2.'commit'2.'commit'2.'commit'3.'force%write'commit'3.'force%write'commit'3.'force%write'commit'4.'ack'4.'ack'4.'ack'5.'Commit'Xact'and'''forget'it'5.'Commit'Xact'and'''forget'it'5.'Commit'Xact'and'''forget'it'5.'Write'end'then'forget'Xact'Xact'is'now'commiled'2 Phase Commit: Phase 1 with abort 14 coor dinator'subordinate'1'subordinate'2'subordinate'3'1.'User'decides'to'commit' 2.'prepare'2.'prepare'2.'prepare'3.'force%write'prepare'3.'force%write'abort'3.'force%write'abort'4.'yes'4.'no'4.'no'5.'Abort'Xact'and'''forget'it'5.'Abort'Xact'and'''forget'it'2 Phase Commit: Phase 2 15 coor dinator'subordinate'1'subordinate'2'subordinate'3'1.'Force%write'abort' 2.'abort'3.'force%write'abort'4.'ack'5.'Abort'Xact'and'''forget'it'5.'Write'end'then'forget'Xact'Restart after failure 16  How'do'we'know'if'we'are'coordinator'or'subordinate,'and'what'do'we'do?' We'see'a'commit'or'abort'record' We'are'coordinator:'send'to'subordinates'unDl'we'get'an'ack' We'see'a'prepare'record' We'are'subordinate:'contact'coordinator'to'determine'status' We'see'no'prepare,'commit'or'abort' We'can'unilaterally'abort'Any'issues?'Refinement: 2PC with presumed abort 17  ObservaDons:' Coordinator'waits'for'acks'to'‘forget’'Xact' no'info rmaDon'='abo rt' A'reader'does'not'care'for'commit/abort'outcome' Refinements:' If'abort'is'decided,'remove'Xact'from'Xact'table'immediately' If'I'get'an'abort'msg ,' no'need'to'ack' The'abort'log'record'of'the'coordinator'does'not'need'the'subordinate'list' Abort'records'don’t'need'to'be'force%wrilen' A'reader'Xact'votes'reader'instead'of'yes/no' Coordinator'does'not'need'to'communicate'further'with'readers'


View Full Document

UW CSE 444 - Introduction to Database Systems

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Introduction to Database Systems
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction to Database Systems and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction to Database Systems 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?