Details
-
Bug
-
Resolution: Obsolete
-
Medium
-
None
-
3.10.0, 4.0.0
-
None
Description
In the processCache() function of eZDBFileHandler, there are some lines that look like:
if ( $this->metaData === false ) $this->loadMetaData(); if ( $this->metaData['mtime'] < 0 ) { if ( $generateCallback !== false ) eZDebugSetting::writeDebug( 'kernel-clustering', "Database file is deleted, need to regenerate data" ); else eZDebugSetting::writeDebug( 'kernel-clustering', "Database file is deleted, cannot get data" ); break; } if ( $this->metaData === false || eZDBFileHandler::isExpired( $fname, $mtime, $this->metaData['mtime'], $curtime, $ttl ) ) // if ( $this->metaData === false || eZDBFileHandler::isExpired( $fname, $mtime, $expiry, $curtime, $ttl ) ) { eZDebugSetting::writeDebug( 'kernel-clustering', "Local file (mtime=$mtime) is older than DB, check with DB" ); $forceDB = true; }
but the test for metadata === false imho should be pushed to the first test case: since we just reloaded metadata, the only case where it is false is if the file is not in the db (it has been purged). This is very similar to the having been deleted, rather than the db version being younger than the local copy.
Correct version:
if ( $this->metaData === false ) $this->loadMetaData(); if ( $this->metaData === false || $this->metaData['mtime'] < 0 ) { if ( $generateCallback !== false ) eZDebugSetting::writeDebug( 'kernel-clustering', "Database file is deleted, need to regenerate data" ); else eZDebugSetting::writeDebug( 'kernel-clustering', "Database file is deleted, cannot get data" ); break; } if ( eZDBFileHandler::isExpired( $fname, $mtime, $this->metaData['mtime'], $curtime, $ttl ) ) // if ( $this->metaData === false || eZDBFileHandler::isExpired( $fname, $mtime, $expiry, $curtime, $ttl ) ) { eZDebugSetting::writeDebug( 'kernel-clustering', "Local file (mtime=$mtime) is older than DB, check with DB" ); $forceDB = true; }
Attachments
Issue Links
- relates to
-
EZP-13872 eZ Publish (cluster) scalability effort
- Closed