Consultor Eletrônico



Kbase 12541: Shared Memory Locks/Latches: User Control Codes in PROMON
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/04/2009
Status: Verified

GOAL:

Shared Memory Locks/Latches: User Control Codes in PROMON

FACT(s) (Environment):

All Supported Operating Systems
Progress/OpenEdge Versions

FIX:

Locks for each of the major data structures are kept in shared memory.
In order to access a data structure, a process must first acquire the appropriate lock. These locks (called "latches") are normally held for very short periods of time, and rarely more than a few microseconds.
The following lists all the latches and the data structures they protect:
- Miscellaneous latches:
The Global Storage Pool (GST) is initially the entire shared memory area. All of the other data structures are allocated from it.
For the most part, they are allocated by the broker during a database restart. The following key values for the cursor pool in Prgress Version 6.x are allocated and freed dynamically after a database restart:
USR User and Server Tables.
SCC Shared Schema Cache.
SEQ Sequence Value Update
OM Object Cache
- Index related latches:
Index Cursor Pool (CUR) in Version 6.3 only.
From Version 7.x, index cursors are not in shared memory but in process private memory.
Deleted Index Entry Chain (DLC).
When unique index entries are deleted, they are replaced by "placeholders" so that the deleted index entry cannot be replaced until after the transaction is committed.
At transaction end, the placeholders are removed and the DLC latch is used to lock the chains of blocks with deleted entries.
- Transaction and logging related latches are:
TXT: Transaction Table.
TXQ: Transaction End Lock Queue
MTX: BI Log Space Allocation and microtransactions
BIB: Before Image Buffers and Control Blocks.
AIB: After Image Buffers and Control Blocks.
- Lock table latches are:
LHT: Lock Table Hash Chains.
LKF: Lock Table Free List.
LKP: Lock Table Purged Lock Chains.
- Buffer Pool Latches:
BFP: Buffer Pool Control Block.
CPQ: Buffer Pool Checkpoint Queue
BHT: Buffer Pool Hash Table.
BUF: Buffer Control Blocks.
BF1: Buffer Pool Control Blocks and Buffers 1
BF2: Buffer Pool Control Blocks and Buffers 1
BF3: Buffer Pool Control Blocks and Buffers 1
BF4: Buffer Pool Control Blocks and Buffers 4
BF5: Buffer Pool Control Blocks and Buffers 5
BF6: Buffer Pool Control Blocks and Buffers 6
BF7: Buffer Pool Control Blocks and Buffers 7
BF8: Buffer Pool Control Blocks and Buffers 8
BFLAST: Last in Buffer Pool
PWQ: Page Writer Work Queue.
LRU: Buffer Pool Primary LRU Chain.
LR2: Buffer Pool Secondary LRU Chain
LR3: Buffer Pool Index LRU Chain
LR4: Buffer Pool Unused LRU Chain
LRLAST: Last in Buffer Pool LRU Chain
When processes wait for these latches, the Progress Monitor shows one of the abbreviations from the above in the "Wait" column of the User Control display (menu choice 1).
Resource Wait Queues:
There are a number of resources when processes might have to wait for access. When they wait, they are queued until the resource becomes available.
The first three resources in the following list are often held for long periods, perhaps several minutes or more. The remaining resources are locked for shorter periods, ranging from less than a millisecond to perhaps half a second, depending on the resource.
The resource queues are:
REC: Record lock (exclusive or share).
SCHE: Schema lock (exclusive or share).
TRAN: Another user's transaction to end.
You must wait for another user's transaction to end when you try to add a record with a unique key that is equal to a key that has been deleted by another user whose transaction is not yet committed.
IXLK: Index lock (exclusive or share - not used in Version 7.x).
Indexes are locked "exclusive" during insert and delete operations and l.ocked "share" for a find operation in Version 6.x.
Version 7.x uses buffer locks during index reads or updates, and does not have index locks.
RGET: Record get.
When you fetch a record with no-lock from the database, you get a temporary record lock. This is to protect against simultaneous updates during the fetch operation.
TXB: Transaction begin.
TXE: End a transaction.
The database manager logging and recovery algorithms require that a transaction end does not occur in-between the several physical changes that are performed during a logical operation (such as updating a fragmented record or inserting an index entry).
Multiple physical changes required to perform a single logical operation are called "microtransactions".
BKSH: Shared access to a database buffer.
BKEX: Exclusive access to a database buffer.
DBRD: Database block to be read from disk.
DBWR: Database block to be written to disk.
DBBK: Database block to be backed up.
BUFF: Unlocked database buffer to be available.
This is unusual and occurs only when you want to read a new block into the buffer pool and all the buffers are locked by other users.
BIRD: Before image buffer to be read from disk.
This occurs when several processes want to access a before-image block that is being read from disk by another process.
This can occur during transaction undo.
BIWR: Before image buffer to be written to disk.
This occurs more frequently when there are not enough before-image buffers (-bibufs too small).
AIWR: After-image buffer to be written to disk.
This occurs more frequently when there are not enough after-image buffers (-aibufs too small).
IDLE AIW and BIW: Waiting for request to write full buffer.
It is normal for the AIW and BIW to be in this state.

.