CENTRAL_LOCK
insteadpublic class PEER_LOCK extends Locking
SEQUENCER
based), lock requests for
the same resource from different senders may be received in different order, so deadlocks can occur. Example:
- Nodes A and B - A and B call lock(X) at the same time - A receives L(X,A) followed by L(X,B): locks X(A), queues L(X,B) - B receives L(X,B) followed by L(X,A): locks X(B), queues L(X,A)To acquire a lock, we need lock grants from both A and B, but this will never happen here. To fix this, either add SEQUENCER to the configuration, so that all lock requests are received in the same global order at both A and B, or use
Lock.tryLock(long,java.util.concurrent.TimeUnit)
with retries if a lock
cannot be acquired.
An alternative is also the CENTRAL_LOCK
protocol.Locking
,
CENTRAL_LOCK
Modifier and Type | Class and Description |
---|---|
protected class |
PEER_LOCK.PeerLock
Deprecated.
Lock implementation which grants a lock when all non faulty cluster members OK it.
|
Locking.ClientCondition, Locking.ClientLock, Locking.ClientLockTable, Locking.LockingHeader, Locking.Request, Locking.Response, Locking.ServerCondition, Locking.ServerLock, Locking.Type
bypass_bundling, client_lock_table, current_lock_id, local_addr, lock_listeners, lock_stripes, lock_striping_size, server_locks, view
after_creation_hook, down_prot, ergonomics, id, log, name, stack, stats, up_prot
Constructor and Description |
---|
PEER_LOCK()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
protected Locking.ClientLock |
createLock(java.lang.String lock_name)
Deprecated.
|
void |
handleView(View view)
Deprecated.
|
protected void |
sendAwaitConditionRequest(java.lang.String lock_name,
Owner owner)
Deprecated.
|
protected void |
sendDeleteAwaitConditionRequest(java.lang.String lock_name,
Owner owner)
Deprecated.
|
protected void |
sendGrantLockRequest(java.lang.String lock_name,
int lock_id,
Owner owner,
long timeout,
boolean is_trylock)
Deprecated.
|
protected void |
sendReleaseLockRequest(java.lang.String lock_name,
int lock_id,
Owner owner)
Deprecated.
|
protected void |
sendReleaseLockRequest(java.lang.String lock_name,
Owner owner)
Deprecated.
|
protected void |
sendSignalConditionRequest(java.lang.String lock_name,
boolean all)
Deprecated.
|
_getLock, addLockListener, createLock, down, getAddress, getBypassBundling, getLock, getLock, getOwner, getView, handleAwaitRequest, handleCreateAwaitingRequest, handleCreateLockRequest, handleDeleteAwaitingRequest, handleDeleteAwaitRequest, handleDeleteLockRequest, handleLockDeniedResponse, handleLockGrantedResponse, handleLockReleasedResponse, handleLockRequest, handleSignalRequest, handleSignalResponse, init, notifyAwaited, notifyAwaiting, notifyLockCreated, notifyLockDeleted, notifyLocked, notifyUnlocked, printLocks, printServerLocks, removeLockListener, send, sendLockResponse, sendRequest, sendRequest, sendSignalResponse, setBypassBundling, unlockAll, up
accept, afterCreationHook, destroy, dumpStats, enableStats, getConfigurableObjects, getDownProtocol, getDownServices, getId, getIdsAbove, getLevel, getLog, getName, getProtocolStack, getSocketFactory, getThreadFactory, getTransport, getUpProtocol, getUpServices, getValue, isErgonomics, level, parse, printStats, providedDownServices, providedUpServices, requiredDownServices, requiredUpServices, resetStatistics, resetStats, setDownProtocol, setErgonomics, setId, setLevel, setProtocolStack, setSocketFactory, setUpProtocol, setValue, setValues, start, statsEnabled, stop, up
protected void sendGrantLockRequest(java.lang.String lock_name, int lock_id, Owner owner, long timeout, boolean is_trylock)
sendGrantLockRequest
in class Locking
protected void sendReleaseLockRequest(java.lang.String lock_name, Owner owner)
protected void sendReleaseLockRequest(java.lang.String lock_name, int lock_id, Owner owner)
sendReleaseLockRequest
in class Locking
protected void sendAwaitConditionRequest(java.lang.String lock_name, Owner owner)
sendAwaitConditionRequest
in class Locking
protected void sendSignalConditionRequest(java.lang.String lock_name, boolean all)
sendSignalConditionRequest
in class Locking
protected void sendDeleteAwaitConditionRequest(java.lang.String lock_name, Owner owner)
sendDeleteAwaitConditionRequest
in class Locking
public void handleView(View view)
handleView
in class Locking
protected Locking.ClientLock createLock(java.lang.String lock_name)
Copyright © 1998-2020 Red Hat. All Rights Reserved.