4.3/4.4
This commit is contained in:
parent
b8bcbb23d0
commit
a3944fd4b9
1 changed files with 13 additions and 12 deletions
|
@ -561,12 +561,12 @@ For locking, due to the variety of locking protocols available, and
|
||||||
their interaction with application
|
their interaction with application
|
||||||
workloads~\cite{multipleGenericLocking}, we leave it to the
|
workloads~\cite{multipleGenericLocking}, we leave it to the
|
||||||
application to decide what degree of isolation is
|
application to decide what degree of isolation is
|
||||||
appropriate. Section~\ref{lock-manager} presents the Lock Manager.
|
appropriate. Section~\ref{lock-manager} presents the lock manager.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\subsection{The Log Manager}
|
\subsection{Log Manager}
|
||||||
\label{log-manager}
|
\label{log-manager}
|
||||||
|
|
||||||
All actions performed by a committed transaction must be
|
All actions performed by a committed transaction must be
|
||||||
|
@ -723,7 +723,7 @@ various primitives that \yad provides to application developers.
|
||||||
\yad provides a default page-level lock manager that performs deadlock
|
\yad provides a default page-level lock manager that performs deadlock
|
||||||
detection, although we expect many applications to make use of
|
detection, although we expect many applications to make use of
|
||||||
deadlock-avoidance schemes, which are already prevalent in
|
deadlock-avoidance schemes, which are already prevalent in
|
||||||
multithreaded application development. The Lock Manager is flexible
|
multithreaded application development. The lock manager is flexible
|
||||||
enough to also provide index locks for hashtable implementations and
|
enough to also provide index locks for hashtable implementations and
|
||||||
more complex locking protocols such as hierarhical two-phase
|
more complex locking protocols such as hierarhical two-phase
|
||||||
locking.~\cite{hierarcicalLocking,hierarchicalLockingOnAriesExample}
|
locking.~\cite{hierarcicalLocking,hierarchicalLockingOnAriesExample}
|
||||||
|
@ -1087,9 +1087,7 @@ trivial). Here we show how increment/decrement map onto \yad operations.
|
||||||
First, we define the operation-specific part of the log record:
|
First, we define the operation-specific part of the log record:
|
||||||
\begin{small}
|
\begin{small}
|
||||||
\begin{verbatim}
|
\begin{verbatim}
|
||||||
typedef struct {
|
typedef struct { int amount } inc_dec_t;
|
||||||
int amount;
|
|
||||||
} inc_dec_t;
|
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\noindent {\normalsize Here is the increment operation; decrement is
|
\noindent {\normalsize Here is the increment operation; decrement is
|
||||||
analogous:}
|
analogous:}
|
||||||
|
@ -1099,11 +1097,11 @@ int operateIncrement(int xid, Page* p, lsn_t lsn,
|
||||||
recordid rid, const void *d) {
|
recordid rid, const void *d) {
|
||||||
inc_dec_t * arg = (inc_dec_t)d;
|
inc_dec_t * arg = (inc_dec_t)d;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
latchRecord(rid);
|
latchRecord(rid);
|
||||||
readRecord(xid, p, rid, &i); // read current value
|
readRecord(xid, p, rid, &i); // read current value
|
||||||
i += arg->amount;
|
i += arg->amount;
|
||||||
// writeRecord updates the page and the LSN
|
|
||||||
|
// write new value and update the LSN
|
||||||
writeRecord(xid, p, lsn, rid, &i);
|
writeRecord(xid, p, lsn, rid, &i);
|
||||||
unlatchRecord(rid);
|
unlatchRecord(rid);
|
||||||
return 0; // no error
|
return 0; // no error
|
||||||
|
@ -1144,13 +1142,16 @@ int Tincrement(int xid, recordid rid, int amount) {
|
||||||
\end{verbatim}
|
\end{verbatim}
|
||||||
\end{small}
|
\end{small}
|
||||||
|
|
||||||
|
|
||||||
With some examination it is possible to show that this example meets
|
With some examination it is possible to show that this example meets
|
||||||
the invariants. In addition, because the REDO code is used for normal
|
the invariants. In addition, because the REDO code is used for normal
|
||||||
operation, most bugs are easy to find with conventional testing
|
operation, most bugs are easy to find with conventional testing
|
||||||
strategies. As future work, there is some hope of verifying these
|
strategies.
|
||||||
invariants statically; for example, it is easy to verify that pages
|
% covered this in future work...
|
||||||
are only modified by operations, and it is also possible to verify
|
%As future work, there is some hope of verifying these
|
||||||
latching for our page layouts that support records.
|
%invariants statically; for example, it is easy to verify that pages
|
||||||
|
%are only modified by operations, and it is also possible to verify
|
||||||
|
%latching for our page layouts that support records.
|
||||||
|
|
||||||
%% Furthermore, we plan to develop a number of tools that will
|
%% Furthermore, we plan to develop a number of tools that will
|
||||||
%% automatically verify or test new operation implementations' behavior
|
%% automatically verify or test new operation implementations' behavior
|
||||||
|
|
Loading…
Reference in a new issue