alfabetización inicial como proceso institucional
CANTIDAD DE RESPUESTAS
The Comm it-Lock Design uses a VMS lock to gener ate groups of comm itt ing transactions; the lock is also used to choose the group commi ttee
Once a process completes all its updates and wants to commit its transaction, the procedure is as fo llows. Each transaction must first declare its i ntent to join a group commit. In KODA, each pro cess uses the i nterlocked queue instructions of the VAX system running VMS software to enqueue a block of commit information, known as a commit packet, onto a global ly accessible commit queue. The commit queue and the commit packets are located in a shared, writeable global section.
Each process then issues a lock request for t he commit lock. At this point, a number of other p rocesses are assumed to be go ing through the same sequence; that is, they are posti ng their commit packets and making lock requests for the commit lock. One of these processes is granted the commit lock. For t he time being, assume the p rocess that currently acquires the lock acts as the group committer.
The group com m itter, first, counts the number of entries on t he commit queue, provid ing the number of transactions that wi ll be part of the group commit. Because of t he VAX i nterlocked queue instructions, scanning to obta i n a count and concurrent queue operations by other processes can p roceed simultaneously. The group committer u ses the information in each commit packet to format the commit block which will be written to disk. In KODA, the commit block is used as a commit list, record i ng which transactions have committed and which ones are active. In order to com mit for a transaction, the group committer must mark each current transaction as completed. In addi tion, as an optimization, the group commit ter assigns a new transaction identifier for each p rocess's next transaction. Figure 4 i l l ustrates a commit block ready to be flushed to disk.
Once the com m it block is mod ified , the group committer writes it to disk in one atomic 1/0. This is the moment of commit for all transactions in the group. Thus, all transactions that were active and took part in this group commit are now stably marked as committed. In add ition, as explained above, these transactions now have new transac tion identifiers. Next, the group commi tter sets a commit flag in each commit packet for all recently committed transactions, removes all comm it pack ets from t he com mit queue, and, finally, releases the commit lock. Figure 5 i l lustrates a committed
Transaction Processing, Databases, and Fault-tolerant Systems
COMMIT PACKET COMMIT
QUEUE
CURR_TI D 37 CURR TID 32 NEXT_TID 0 NEXT -TID 0 COMMIT_FLG 0 COMMIT_FLG 0 COMMIT GROUP KEY: CURR_TID NEXT_TID 37 42 32 43 41 44 COMMIT BLOCK
CURR_ TID CURRENT TRANSACTION IDENTIFIER NEXT TID NEXT TRANSACTION I DENTIFIER COMMIT_FLG COMMIT FLAG
CURR TID 4 1 CURR TID 28 CURR_TID 39 NEXT -TID 0 NEXT -TID 0 NEXT TID 0 COMMIT_FLG 0 COMMIT_FLG 0 COMMIT_FLG 0
Figure 4 Commit Block Ready to be Flushed to Disk
group with new transaction identifiers and with com mit flags set.
At this point, the rema ining processes that were part of the group commit are, i n turn, granted the commit Jock. Because their commit flags are already set, these processes realize they do not need to perform a commi t and, thus, release the commit lock and proceed to the next transaction. After all these committed processes release the commit lock, a process that did not take part in the
COMMIT QUEUE CURR TID -1 NEXT -TID 42 COMMIT _FLG 1 KEY: CURR TID -1 NEXT -TID 43 COMMIT _FLG 1 COMMITTED GROUP CURR TID -1 NEXT -TID 44 COMMIT_FLG 1
CURR TID CURRENT TRANSACTION IDENTIFIER NEXT -TID NEXT TRANSACTION IDENTIFIER COMMIT _FLG COMMIT FLAG
group commit acquires the lock, notices it has not been commi tted, and, therefore, init iates the next group commit.
There are several i nteresting points about using the
VMS
Jock as the grouping mechanism. Even though all the transactions are effectively commit ted after the comm i t block l/0 has completed, the transactions are sti l l forced to proceed serially; that is, each p rocess is granted the lock, notices that it is comm it ted, and then releases the Jock.NEXT COMMIT PACKET
CURR TID 28 CURR TID 39 CURR TID 29 NEXT -TID NEXT -TID 0 NEXT -TID 0 COMMIT_FLG 0 COMMIT_FLG 0 COMMIT_FLG 0
Figure 5 Committed Group
So there is a serial procession of lock enqueues/ dequeues before the next group can start.
This serial procession can be made more concur rent by, first, requesting the lock i n a shared mode, hoping that aU p rocesses commit ted are granted the lock in unison. However, in practice, some pro cesses that are granted the lock are not committed. These p rocesses must then request the lock i n an exclusive mode. If this lock request is mastered on a d ifferent node in a VAXcluster system , the lock enqueue/dequeues are very expensive.
Also, there is no expl ici t stall time built into the algorithm. The latency associated with the lock enqueue/dequeue requests al lows the commit queue to build up. This stall is entirely dependent on the contention for the lock, which in turn depends on the throughput.