This is an utility class which provides index locks processing functionality
category | Zend |
---|---|
package | Zend_Search_Lucene |
copyright | Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) |
license | New BSD License |
deEscalateReadLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory)
\Zend_Search_Lucene_Storage_Directory
escalateReadLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory) : boolean
\Zend_Search_Lucene_Storage_Directory
boolean
obtainOptimizationLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory) : mixed
Returns lock object on success and false otherwise (doesn't block execution)
\Zend_Search_Lucene_Storage_Directory
mixed
obtainReadLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory) : \Zend_Search_Lucene_Storage_File
It doesn't block other read or update processes, but prevent index from the premature cleaning-up
\Zend_Search_Lucene_Exception |
---|
\Zend_Search_Lucene_Storage_File
obtainWriteLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory) : \Zend_Search_Lucene_Storage_File
\Zend_Search_Lucene_Storage_Directory
\Zend_Search_Lucene_Exception |
---|
\Zend_Search_Lucene_Storage_File
releaseOptimizationLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory)
\Zend_Search_Lucene_Storage_Directory
releaseReadLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory)
\Zend_Search_Lucene_Storage_Directory
releaseWriteLock(\Zend_Search_Lucene_Storage_Directory $lockDirectory)
\Zend_Search_Lucene_Storage_Directory
_startReadLockProcessing(\Zend_Search_Lucene_Storage_Directory $lockDirectory) : \Zend_Search_Lucene_Storage_File
Required to protect the escalate/de-escalate read lock process on GFS (and potentially other) mounted filesystems.
Why we need this: While GFS supports cluster-wide locking via flock(), it's implementation isn't quite what it should be. The locking semantics that work consistently on a local filesystem tend to fail on GFS mounted filesystems. This appears to be a design defect in the implementation of GFS. How this manifests itself is that conditional promotion of a shared lock to exclusive will always fail, lock release requests are honored but not immediately processed (causing erratic failures of subsequent conditional requests) and the releasing of the exclusive lock before the shared lock is set when a lock is demoted (which can open a window of opportunity for another process to gain an exclusive lock when it shoudln't be allowed to).
\Zend_Search_Lucene_Storage_Directory
\Zend_Search_Lucene_Exception |
---|
\Zend_Search_Lucene_Storage_File
_stopReadLockProcessing(\Zend_Search_Lucene_Storage_Directory $lockDirectory)
Required to protect the escalate/de-escalate read lock process on GFS (and potentially other) mounted filesystems.
\Zend_Search_Lucene_Storage_Directory
OPTIMIZATION_LOCK_FILE = 'optimization.lock.file'
READ_LOCK_FILE = 'read.lock.file'
READ_LOCK_PROCESSING_LOCK_FILE = 'read-lock-processing.lock.file'
WRITE_LOCK_FILE = 'write.lock.file'