The document describes the functions and operations of a Transaction Manager (TM). The TM receives calls to begin, save, prepare, commit, rollback transactions and read transaction contexts. It maintains data structures for transactions, resource managers, and sessions. It implements transaction functions like begin, commit through logging savepoints and coordinating with resource managers. On restart, it replays the log through REDO and UNDO operations to recover state and ensure transactions are recovered to a consistent state.
C lecture 4 nested loops and jumping statements slideshareGagan Deep
Nested Loops and Jumping Statements(Loop Control Statements), Goto statement in C, Return Statement in C Exit statement in C, For Loops with Nested Loops, While Loop with Nested Loop, Do-While Loop with Nested Loops, Break Statement, Continue Statement : visit us at : www.rozyph.com
A scrupulous code review - 15 bugs in C++ codePVS-Studio LLC
A close look at 15 problems one can find when reviewing C++ code.
Offers code examples.
Covers indexed loops, tainted data, copy and paste errors, problems with comparisons, exceptions, etc.
You can use static code analysis tools to make code review easier. Code analyzers find errors and potential vulnerabilities in code, while saving the developers' time and the companies' money.
Manual code review is expensive - a group of programmers get together regularly to review the code.
One can run static analysis tools regularly to find mistakes and vulnerabilities early.
An autonomous transaction has its own COMMIT and ROLLBACK scope to ensure that its outcome does not effect the caller’s uncommitted changes. Additionally, the COMMITs and ROLLBACK in the calling transaction should not effect the changes that were finalized on the completion of autonomous transaction itself.
C lecture 4 nested loops and jumping statements slideshareGagan Deep
Nested Loops and Jumping Statements(Loop Control Statements), Goto statement in C, Return Statement in C Exit statement in C, For Loops with Nested Loops, While Loop with Nested Loop, Do-While Loop with Nested Loops, Break Statement, Continue Statement : visit us at : www.rozyph.com
A scrupulous code review - 15 bugs in C++ codePVS-Studio LLC
A close look at 15 problems one can find when reviewing C++ code.
Offers code examples.
Covers indexed loops, tainted data, copy and paste errors, problems with comparisons, exceptions, etc.
You can use static code analysis tools to make code review easier. Code analyzers find errors and potential vulnerabilities in code, while saving the developers' time and the companies' money.
Manual code review is expensive - a group of programmers get together regularly to review the code.
One can run static analysis tools regularly to find mistakes and vulnerabilities early.
An autonomous transaction has its own COMMIT and ROLLBACK scope to ensure that its outcome does not effect the caller’s uncommitted changes. Additionally, the COMMITs and ROLLBACK in the calling transaction should not effect the changes that were finalized on the completion of autonomous transaction itself.
We all have good and bad thoughts from time to time and situation to situation. We are bombarded daily with spiraling thoughts(both negative and positive) creating all-consuming feel , making us difficult to manage with associated suffering. Good thoughts are like our Mob Signal (Positive thought) amidst noise(negative thought) in the atmosphere. Negative thoughts like noise outweigh positive thoughts. These thoughts often create unwanted confusion, trouble, stress and frustration in our mind as well as chaos in our physical world. Negative thoughts are also known as “distorted thinking”.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Synthetic Fiber Construction in lab .pptxPavel ( NSTU)
Synthetic fiber production is a fascinating and complex field that blends chemistry, engineering, and environmental science. By understanding these aspects, students can gain a comprehensive view of synthetic fiber production, its impact on society and the environment, and the potential for future innovations. Synthetic fibers play a crucial role in modern society, impacting various aspects of daily life, industry, and the environment. ynthetic fibers are integral to modern life, offering a range of benefits from cost-effectiveness and versatility to innovative applications and performance characteristics. While they pose environmental challenges, ongoing research and development aim to create more sustainable and eco-friendly alternatives. Understanding the importance of synthetic fibers helps in appreciating their role in the economy, industry, and daily life, while also emphasizing the need for sustainable practices and innovation.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
What is the purpose of the Sabbath Law in the Torah. It is interesting to compare how the context of the law shifts from Exodus to Deuteronomy. Who gets to rest, and why?
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
Unit 8 - Information and Communication Technology (Paper I).pdf
11 tm
1. Transaction Manager
Software is like entropy.
It is difficult to grasp,
weighs nothing,
and obeys the Second Law of Thermodynamics;
i.e., it always increases.
Norman Augstine
9:00
11:00
1:30
3:30
7:00
Overview
Faults
Tolerance
T Models
Party
TP mons
Lock Theory
Lock Techniq
Queues
Workflow
Log+RM
TM
CICS & Inet
Adv TM
Cyberbrick
Files &Buffers
COM+
Corba
Replication
Party
B-tree
Access Paths
Groupware
Benchmark
Mon Tue Wed Thur Fri
2. When Everything Works
Normally, no resorce manager fails, and the
system is up.The TM receives the following
calls:
Begin_Work(),
Save_Work(),
Prepare_Work(),
Commit_Work(),
Rollback_Work(),
Read_ Context().
3. Other “Normal” Calls
Normally, no resorce manager fails, and the
system is up.The TM receives the following
calls:
Leave_Transaction(),
Resume_Transaction(),
Status_Transaction(),
Identify(),
Join_Work().
4. The TM And Context
With each type of savepoint, the TM can
record context information for the transaction.
Context is provided by a resource manager and
can be reestablished when the transaction
returns to that savepoint.
For the TM, context is only a string of bytes.
The “meaning” of context is only understood
by the subsystem that created it. The context
established by a database system is different
from the one provided by a transactional GUI.
5. Transaction Identifiers
TRIDs must be created at high rates at each
node in a distributed system. TRIDs must be
unique in time and space.
This is the structure of a TRID:
typedef struct {TIMESTAMP BirhtdayOf TM;
RMID IDofTM;
long LocalSqncNo;
char FutureUse[2];
} TRID;
7. What the TM Knows About RMs
typedef struct
{ RMCB * NextRMCB;
char RMName[BIG];
RMID IDofRM;
Boolean RMisUP;
LSN OldestLogRecForREDO;
LSN CheckpointLSN;
} RMCB;
8. What the TM Knows About Transactions
typedef struct
{ TransCB * NextTranCBt;
TRID TRIDofTran;
tran_status StatusOfTran;
long NextSaveptNo;
long CurrentSaveptNo;
LSN LSNofCurrentSavept;
LSN MostRecentLSNofTran;
LSN FirstLSNofTran;
to be continued ...
10. Some Simple Addressing Functions
TRID MyTrid(void);
Returns transaction identifier of caller’s process.
TransCB MyTrans(void);
Returns a copy of caller’s transaction CB.
TransCB * MyTransP(void);
Returns pointer to caller’s transaction CB.
11. Implementation of MyTrid
TRID MyTrid(void)
/*return curr. TRID of calling process*/
{ TransCB * mytranp = MyTransP();
/*pointer to caller’s TA CB */
if ( mytranp != NULL )
return mytranp->trid;
/*return his trid if he has one*/
else return NULLTrid;}
/*no trid if caller has no control blk*/
16. Implementation of Commit_Work
Boolean Commit_Work(context * it, Boolean lazy)
{ TransCB * trans = MyTransP();
TM_savepoint save;
long save_num
Boolean vote;
RMTransCB * rm;
SECB * session;
if (MyTrid() == NULLTrid) return(0);
for each rm in trans->RM_list
{rm->prepared =rmid.Prepare(&rm->save_pt_lsn))
if (!rm->prepared)
{ Abort_Work();
return FALSE;};}
17. Implementation of Commit_Work
for each outgoing session in trans->ses_list
{vote = TM.Prepare(void);
if (! vote or timeout)
{ Abort_Work();
return FALSE;};};
trans->status = PREPARED;
save_num = trans->save_pt ++;
save.record_type = commit;
save.soft = FALSE;
save.save_pt_num = save_num;
copy(save, trans->RM_list);
copy(save, trans->ses_list);
copy(save.it, it);
18. Implementation of Commit_Work
trans->save_pt_lsn = log_insert( save, sizeof(save));
log_flush(trans->max_lsn, lazy);
trans->status = COMMITTING;
for each rm in trans->RM_list
{ if ( rmid.Commit( ))
{ deallocate rmid from transaction;};
else {rm_commit(&rm);};};
for each outgoing session in trans->ses_list
{ TM.Commit();
if (! timeout) { free session; }
else {session_failure(&session);};};
19. Implementation of Commit_Work
if ( trans->RM_list == NULL &&
trans->ses_list == NULL)
{ trans->status = COMMITTED;
save.record_type = commit_complete;
log_insert( save, sizeof(header)+sizeof(record_type));
dequeue and free trans structure;}
(MyProcessP())->trid = NULLTrid;
return TRUE;
};
20. Data Flow at Commit
Savepoint
Rollback
Prepare
Commit /
Abort
From Application or
Remote Transaction
Manager
Local
Transaction
Manager
Joined
Resource
Managers
Outgoing Sessions
Remote
Transaction
Managers
and Servers
24. Savepoint Logic
RM 1
Save Point
Log Record
RM 2
Save Point
Log Record
Transaction
Manager's
Save Point
Log Record
Transaction's Log
Records Increassing LSNs
In the TM´s savepoint record, the LSNs of the
participating resource managers are recored, so
they can be reestablished later on.
25. Savepoint Implementation
int Save_Work(context * it, Boolean soft)
{TransCB * trans = MyTransP();
TM_savepoint save;
long save_num;
RMTransCB * rm;
SECB * session;
Boolean vote;
if (MyTrid() == NULLTrid) return(0);
save_num = trans->next_save_pt + +;
for each rm in trans->RM_list
if( ! vote = rmid.Savepoint(&rm->save_pt_lsn )))
{ Abort_Work(); return 0;};
27. The UNDO of Savepoints
void UNDO(LSN lsn)
{TransCB * trans = MyTransP();
TM_savepoint save;
TRID him =MyTrid();
RMID rmid;
RMTransCB * rm;
SECB * session;
log_record_header header;
Boolean vote=TRUE;
log_read(lsn,&header,save,sizeof(save));
trans->save_pt = save.save_pt_num;
28. The UNDO of Savepoints
for each rm in trans->RM_list
{ if ( rm is in save )
rm->save_pt_lsn = save.RM.save_pt_lsn;
else rm->save_pt_lsn = NULLlsn;.
vote= vote ||
rmid.UNDO_Savepoint(rm->save_pt_lsn);}
for each session in trans->ses_list
vote = vote || TM.UNDO_Savepoint(trans->save_pt);
if ( vote )
{ trans->max_lsn = header.tran_prev_lsn;
trans->save_pt_lsn =
log_insert(save,sizeof(save));}
return;};
30. System Restart
R E D O T r a n s a c t io n M a n a g e r
C h e c k p o in t C h e c k p o in t
U N D O
C h e c k p o in t
C o m p e n s a t io n L o g R e c o r d s
G e n e r a t e d B y U n d o S c a n
L o g a t R e s t a r t : R E D O s c a n f o r w a r d f r o m la s t c h e c k p o in t
L o g u n c h a n g e d : U N D O s c a n b a c k f r o m e n d o f lo g a lo n g t r a n p r e v ls n
U N D O s c a n g e n e r a t e d c o m p e n s a t io n r e c o r d s ( u n d o lo g g in g )
A t e n d o f U N D O s c a n , c h e c k p o in t a n d m a r k r e s o u r c e m a n a g e r a s u p
I d e n t if y ( R M I D )
R E D O f r o m t h a t R M I D lo w w a t e r ls n R E D O c a llb a c k s
U N D O c a llb a c k s
R e t u r n f r o m I d e n t if y ( )
N o w T r a n s a c t io n M a n a g e r is " u p "
T M ( c h k p _ ls n )
31. Transaction States at Restart
b e g in
d o
d o
d o
b e g in
d o
c o m m it
c o m p le te
b e g in
d o
d o
r o llb a c k
u n d o
u n d o
a b o r t
c o m p le te
b e g in
d o
d o
c o m m it
b e g in
d o
d o
r o llb a c k
u n d o
u n d o
a b o r t
b e g in
d o
d o
p e r s is te n t s a v e
b e g in
d o
d o
p r e p a r e
C o m p le t e dC o m p le t in g
P e r s is te n t
b e g in
d o
d o
p e r s is te n t s a v e
d o
d o
A c t iv e
F a ilu r e & R e s t a r t R E D O in
p e r s is te n t s to r a g e
R E D O in p e r s is te n t s to r a g e
te ll e a c h r e s o u r c e m a n a g e r
th e n w r ite c o m p le tio n r e c o r d
R E D O in p e r s is te n t s to r a g e
te ll e a c h r e s o u r c e m a n a g e r
to b e p r e p a r e d
R E D O in p e r s is te n t s to r a g e
U N D O to p e r s is te n t s a v e
if n o n e , d o a b o r t lo g ic
33. Using Two Checkpoints For Restart
One scan for ALL RMs
REDO
Checkpoint Checkpoint
UNDO
Checkpoint
CompensationLog
Records
GeneratedBy UndoScan
Logat Restart: REDOscanforwardfrom2ndtolast checkpoint
Logunchanged: UNDOscanbackfromendof logalongtran prevlsn
UNDOscangeneratedcompensationrecords (undologging)
At endof UNDOscan, checkpoint andallownewtransactions tobegin
34. Why Restart Works
A case analysis of the restart state of a transaction’s outcome,
its log record and the state of the page in persistent memory.
Transacti
on
Log
record
Persistent
Page
Why Recovery Works
1 committe
d
volatile old impossible: force-log -
at-commit
2 new impossible:
WAL +force-log-at -
commit
3 durable old REDO makes it new
4 new REDO idempotence
5 aborted volatile old no record at restart
(implicit UNDO).
6 new impossible: WAL
7 durable old REDO then UNDO
8 new REDO idempotence +
UNDO