CS430 CH 14, 15 & 16 Terms
Define Durability
After a transaction completes successfully, the change sit has made to the database persists.
Write ahead logging
Any change to a database object if first recorded in the log, the record in the log must be written to stable storage before the change to the database is written to disk
Define Consistency
Execution of a transaction in isolation preserves the consistency of the database
Redo
Repeats all actions, starting from an appropriate point in the log, and restores the database state to what it was at the time of the crash
The state after the transaction has been rolled back and the database has been restored to its state prior to the start of the transaction:
aborted
Repeatable read
allows only committed data to be read and requires that between two reads of a item by a transaction, no other transaction may update it
Read uncommitted
allows uncommitted data to be read
length
length in bytes of the change
When a transaction holds a shared lock on an object, and wants to acquire an exclusive lock, it ussues a:
lock upgrade
A set of rules that we require each transaction to following while acquiring and releasing locks is called what?
locking protocol
The act of granting an exclusive lock to a transaction that holds a shared lock - called a lock upgrade - fails under which of the following conditions. -If no other transactions hold any locks. -If a transaction other than the one requesting the lock upgrade holds an exclusive lock. -If no other transaction holds a shared lock on the object. - If no other transaction holds an exclusive lock on the object. -None of the above
none of the above
Which of the following is true about checkpointing? 1) A checkpoint is like a snapshot of the DBMS state. 2) When a system comes back after a crash, the restart process begins by locating the most recent checkpoint record. 3) A fuzzy checkpoint is one where the system is not quiesed. 4) Taking a checkpoint periodically reduces the amount of work to be done during restart. 5)Taking a checkpoint periodically increases the amount of work to be done during restart.
A checkpoint is like a snapshot of the DBMS state. When a system comes back after a crash, the restart process begins by locating the most recent checkpoint record. A fuzzy checkpoint is one where the system is not quiesed. Taking a checkpoint periodically reduces the amount of work to be done during restart.
Which of the following best describes a schedule?
A list of actions (reading, writing, aborting, committing) from a set of transactions and the order in which the actions occur.
We can prevent deadlocks by giving each transaction a priority and ensuring that lower transactions are not allowed to wait for higher priority transactions. One way is to assign timestamps to each transaction. When are these timestamps assigned?
At the time the transaction starts up.
Logging changes during undo
Changes made to a database while undoing a transaction are logged to ensure such an action is not repeated in the event of repeated restarts
Which of the following are true about the dirty page table used by the ARIES algorithm? 1)Contains one entry for every dirty page in the buffer pool. 2)Is reconstructed during the Analysis phase of the recovery algorithm. 3)Contains one entry for every page in the buffer pool, with a bit describing whether it is dirty or not. 4)The entry contains a field called recLSN, which is the LSN of the first log record that caused the page to be dirty. 5)Contains a field called recLSN which identifies the earliest log record that might have to be redone for this page during the restart from a crash.
Contains one entry for every dirty page in the buffer pool. Is reconstructed during the Analysis phase of the recovery algorithm. The entry contains a field called recLSN, which is the LSN of the first log record that caused the page to be dirty.
Define Atomicity
Either all the operations of the transaction are reflected properly in the database, or none are.
Define Isolation
Even though multiple transactions may execute concurrently, the system guarantees that, for every pair of transactions T1 and T2, it appears that T1 executed before T2 or T2 executed before T1
When timestamp-based concurrency control is used, transactions are assigned a timestamp when they begin. This timestamp is used to ensure conflict serializability. When a transaction wants to write an object O, which of the following are checks done to ensure serializability?
If TS(T) < RTS(O), the write action conflicts with the most recent read action of O, and T is aborted and restarted If TS(T) < WTS(O), the Thomas Write Rule allows us to ignore the outdated write. If all checks are valid, T writes O, and WTS(o) is set to TS(T).
Which of the following are true about parsing the log during the Analysis phase? 1) If a commit log record is encountered, the status of the transaction is set to C. 2) If a log record other than the end record for a transaction T is encounted, an entry for T is added to the transaction table if it is not already there. 3) If a log record other than the end record for a transaction T is encounted, the lastLSN field is set the the LSN of the log record. 4) If a redoable log record affecting page P is encountered and P is not in the dirty page table, an entry is inserted into the table with recLSN equal to the LSN of this redoable log record. 5) If an end log record for a transaction T is encountered, T is removed from the transaction table.
If a commit log record is encountered, the status of the transaction is set to C. If a log record other than the end record for a transaction T is encounted, an entry for T is added to the transaction table if it is not already there. If a redoable log record affecting page P is encountered and P is not in the dirty page table, an entry is inserted into the table with recLSN equal to the LSN of this redoable log record. If an end log record for a transaction T is encountered, T is removed from the transaction table.
Which of the following actions does the lock manger take upon receiving a lock request from a transaction? 1) If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is suspended. 2) If a shared lock is requested, the queue of requests is empty, and the object is not currently locked in exclusive mode, the lock manager grants the lock and updates the lock entry table for the object. 3) If an exclusive lock is requested and no transaction currently holds a lock on the object (which also implies the queue of requests is empty), the lock manager grants the lock and updates the lock table entry for the object. 4) If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is aborted.
If the requested lock cannot be immediately granted, the lock request is added to the queue of lock requests for this object and the transaction is suspended. If a shared lock is requested, the queue of requests is empty, and the object is not currently locked in exclusive mode, the lock manager grants the lock and updates the lock entry table for the object. If an exclusive lock is requested and no transaction currently holds a lock on the object (which also implies the queue of requests is empty), the lock manager grants the lock and updates the lock table entry for the object.
Two schedules are said to be conflict equivalent if they do which of the following.
Involve the same set of actions of the same transactions and they order every pair of conflicting actions of two committed transactions in the same way.
How many valid serial schedules exist for a net of N transactions?
N!
Which of the following is not a transaction state? Active Aborted None of the answers provided Committed
None of the answers provided
Repeating history during redo
On restart following a crash, the recovery system traces all actions of the DBMS before the crash and brings the system back to the exact state it was in at the time of the crash
The difference between two-phase locking protocol and strict two-phase locking protocol is:
That under strict two-phase locking protocol, all exclusive locks must be held until the commit.
Which of the following are true about the transaction table used in ARIES? 1) The status of a transaction can be in progress, committed, aborted. 2) Each entry in the transaction table contains (among other things) the transaction id, the status, and the LastLSN - the LSN of the most recent log entry for this transaction. 3) Contains one entry for every active transaction 4) Contains one entry for every active log record written by a transaction 5) The status of a transaction can be waiting, ready, or blocked.
The status of a transaction can be in progress, committed, aborted. Each entry in the transaction table contains (among other things) the transaction id, the status, and the LastLSN - the LSN of the most recent log entry for this transaction. Contains one entry for every active transaction
What tasks are performed during the Analysis phase of the ARIES algorithm? 1) The transactions that were active at the time of the crash and must be undone are determined. 2)A subset of the pages in the buffer pool are determined that were dirty at the time of the crash. 3) A superset of the pages in the buffer pool are determined that were dirty at the time of the crash. 4) The point in the log is determined at which to start the Undo phase. 5) The point in the log is determined at which to start the Redo phase.
The transactions that were active at the time of the crash and must be undone are determined. A superset of the pages in the buffer pool are determined that were dirty at the time of the crash. The point in the log is determined at which to start the Redo phase.
A precedence graph - also known as a serializability graph - captures all the potential conflicts between transactions in a schedule. Which of the following is true about a precedence graph?
There exists a node for each committed transaction in S. There exists an edge from Ti to Tj if an action of Ti precedes and conflicts with one of Tj's actions.
In the validation phase of optimistic concurreny control, timestamps are assigned to the transactions and a set of criterion is applied to see whether the time-stamp ordering of transactions is equivalent to some serial order. For every pair of transactions Ti and Tj such that TS(Ti) ≤ TS(Tj), one of the following selections must hold: 1)Tj completes all three phases before Ti begins. 2)Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj. 3)Ti completes its read phase before Tj completes its read phase and Ti does not write any database object that is either read or written by Tj 4)Ti completes all three phases before Tj begins.
Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj. Ti completes its read phase before Tj completes its read phase and Ti does not write any database object that is either read or written by Tj Ti completes all three phases before Tj begins.
In the validation phase of optimistic concurreny control, timestamps are assigned to the transactions and a set of criterion is applied to see whether the time-stamp ordering of transactions is equivalent to some serial order. For every pair of transactions Ti and Tj such that TS(Ti) ≤ TS(Tj), one of the following selections must hold: 1) Ti completes its read phase before Tj completes its read phase and Ti does not write any database object that is either read or written by Tj 2) Ti completes all three phases before Tj begins 3) Tj completes all three phases before Ti begins. 4) Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj.
Ti completes its read phase before Tj completes its read phase and Ti does not write any database object that is either read or written by Tj Ti completes all three phases before Tj begins Ti complete before Tj starts its write phase and Ti does not write any database object read by Tj.
Which of the following are valid phases of the Aries recovery algorithm?
Undo Redo Analysis
In a deadlock prevention system using timestamps, there are two policies the lock manager can use to prevent deadlock if Ti requests a lock that Tj holds. Which of the following are they? 1)Wound-wait: if Ti has a higher priority, abort Tj; otherwise, Ti waits. 2)Wait-die - if Ti has a lower priority, it is allowed to wait; otherwise it is aborted. 3)Wait-die - if Ti has a higher priority, it is allowed to wait; otherwise it is aborted. 4)Wound-wait: if Ti has a higher priority, abort Ti; otherwise, Tj waits.
Wound-wait: if Ti has a higher priority, abort Tj; otherwise, Ti waits. Wait-die - if Ti has a higher priority, it is allowed to wait; otherwise it is aborted.
Read committed
allows only committed data to be read, but does not require repeatable read
After a crash, the transaction table is rebuilt during which phase?
analysis
The state after the transaction has successfully completed:
committed
The database system must control the interaction among concurrent transaction to prevent them from destroying the consistency of the database. This is done through a variety of mechanisms called the ______________-control schemes.
concurrency
Which properties does the following schedule have? T1 T2 ----------- R(A) W(A) R(A) W(A) R(B) W(B) R(B) W(B) Commit Commit
conflict serializable and recoverable
A set of transactions fail to make progress due to a cycle of lock requests. This problem is best described by which term?
deadlock
If transaction T1 holds a read lock on data item A and is requesting a write lock on B, while at the same time transaction T2 holds a read lock on B and is requesting a write lock on A - this situation is known as ____________
deadlock
The recovery manager is responsible for ensuring which of the following transaction properties.
durability and atomocity
Serializable
ensures serializable execution
In a real database system, the write operation updates the data on disk:
eventually
If a transaction T has obtained an _________________ lock on item Q, then T can both read and write Q.
exclusive
The state after the discovery that normal execution can no longer proceed:
failed
A compensation log record (CLR) is written just after the change recorded in an update log record is undone.
false
A schedule is view serializable if and only if it is view equivalent to some conflict serializable schedule.
false
A transaction is a single operation that performs multiple logical functions within a database.
false
Ensuring atomicity is the responsibility of the system administrator.
false
Every serializable schedule is conflict serializable.
false
If a lock is acquired on the entire database before each transaction starts, and released when it is committed, a conflict serializable schedule is created, but not a view serializable one.
false
In a database, a write() operation ensures the immediate write of the variable to persistent storage.
false
In a timestamp concurrency control system, timestamps are assigned by the system administrator before the transaction begins.
false
Multiversion concurrency control is rarely used in today's systems.
false
The log, sometimes called the trail or journal, is a history of actions executed by the lock manager.
false
The recLSN field in the dirty page table identifies the latest change to page P that may not have been written to disk.
false
Using multigranularity locking, if a node is locked in IS mode, implicit locking is done at the lower level of the tree, but only with shared locks.
false
Using multigranularity locking, if a node is locked in IX mode, explicit locking is done at the lower level of the tree, but only with shared locks.
false
The policy that allows a transaction to commit even if it has modified some blocks that have not yet been written back to disk is called the __________ policy.
first-update-wins
Analysis
identifies dirt pages in the buffer pool and active transactions at the time of crash
Which of the following are reasons to allow transactions to run concurrently rather than serially?
improved throughput and resource allocation, reduced waiting time, and multi-user support
Define volatile storage
information that does not survive a system crash
Define stable storage
information that is never lost
Define non-volatile storage
information that survives a system crash
What is the lowest isolation level allowed by SQL?
read uncommitted
A ___________ schedule is one where, for each pair of transactions T1 and T2, such that T1 reads a data item previously written by T2, the commit operation of T2 appears before the commit operation of T1.
recoverable
A lock protocol assumes that all locks be two-phase and that all locks be held until the transaction commits. Which term below would best describe this protocol?
rigorous two phase locking
If a transaction T has obtained a ______________ lock on item Q, then T can read but not write Q.
shared
offset
the offset within the record of the change
pageID
the page id of the modified page
Who is responsible for ensuring durability (and atomicity)?
the recovery system
What can you say about a schedule whose precedence graph contains no cycles?
the schedule is recoverable, and conflict serializable
after-image
the value of the changed byte afterthe change
before-image
the value of the changed byte before the change
What is a waits-for graph used for?
to detect deadlock cycle
A schedule is conflict serializable if it is conflict equivalent to some serial schedule.
true
Aborting a transaction is just a special case of the Undo phase of restart in which a single transaction is undone.
true
If during the Redo phase a logged action must be redone, the logged action is reapplied, and the pageLSN on the page is set to the LSN of the redone log record.
true
One of the key factors to the success of the recovery algorithm is the Write Ahead Log (WAL) protocol. WAL forces all log records up to and including the one with LSN equal to the pageLSN to stable storage before writing the page to disk.
true
Starvation occurs when a transaction is unable to ever acquire the resources (locks) necessary for it to complete.
true
Strict 2 phase locking protocol allows only conflict serializable schedules.
true
The DBMS sees a transaction as a series of reads, writes, and a commit/abort.
true
The log tail - which is the most recent portion of the log, is kept in main memory and is periodically forced to stable storage. This allows log records and data records to be written to the disk at the same granularity.
true
Using multigranularity locking, if a node is locked in SIX mode, The sub-tree rooted by that node is locked explicitly in shared mode, and explicit locking is done at the lower level of the tree with exclusive locks.
true
Undo
undoes the actions of the transactions that did not commit, so that the database reflects only the actions of committed transactions