Skip to content

Commit

Permalink
refs #4903 removing this lock as it does not work anyway. After locki…
Browse files Browse the repository at this point in the history
…ng the table the lock will be immediately released when inserting the new archiving id as there is a second get_lock call. According to MySQL and tests have proven it a lock is released when you execute a new GET_LOCK()
  • Loading branch information
tsteur committed Mar 28, 2014
1 parent 1ea5af9 commit a0acaac
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions core/DataAccess/ArchiveWriter.php
Expand Up @@ -111,7 +111,6 @@ public function getIdArchive()

public function initNewArchive()
{
$this->acquireLock();
$this->allocateNewArchiveId();
$this->logArchiveStatusAsIncomplete();
}
Expand All @@ -120,16 +119,6 @@ public function finalizeArchive()
{
$this->deletePreviousArchiveStatus();
$this->logArchiveStatusAsFinal();
$this->releaseArchiveProcessorLock();
}

protected function acquireLock()
{
$lockName = $this->getArchiveProcessorLockName();
$result = Db::getDbLock($lockName, $maxRetries = 30);
if (!$result) {
Log::debug("SELECT GET_LOCK failed to acquire lock. Proceeding anyway.");
}
}

static protected function compress($data)
Expand Down Expand Up @@ -210,11 +199,6 @@ protected function logArchiveStatusAsIncomplete()
$this->insertRecord($this->doneFlag, $statusWhileProcessing);
}

protected function getArchiveProcessorLockName()
{
return self::makeLockName($this->idSite, $this->period, $this->segment);
}

/**
* This lock is to ensure that a given archive is only processed once.
*
Expand Down Expand Up @@ -265,12 +249,6 @@ protected function logArchiveStatusAsFinal()
$this->insertRecord($this->doneFlag, $status);
}

protected function releaseArchiveProcessorLock()
{
$lockName = $this->getArchiveProcessorLockName();
return Db::releaseDbLock($lockName);
}

protected function insertBulkRecords($records)
{
// Using standard plain INSERT if there is only one record to insert
Expand Down

0 comments on commit a0acaac

Please sign in to comment.