Forums / General / Cluster mode problem

Cluster mode problem

Author Message

Joël LEGER

Thursday 27 August 2009 7:22:41 am

Hi,

version:4.1.3
Cluster mode

I have a regular problem (recently)
example :

Error: _endCacheGeneration( var/client/cache/template-block/1/2/4/1242146676.cache )  	

Failed to execute SQL for function:
1062: Duplicate entry 'a1e80d95fa90890ea8b43319ab9fc150-0' for key 1

 

result it's very slow

Jean-Luc Nguyen

Thursday 27 August 2009 10:04:58 am

Hello,

Try to check in /var/log/error.log the SQL error details.

http://www.acidre.com

Joël LEGER

Thursday 27 August 2009 10:27:19 am

Same thing

Bertrand Dunogier

Thursday 27 August 2009 11:30:42 pm

Could you provide me with:
1) your settings/override/file.ini.append.php file
2) the definition for the cluster tables, ezdbfile and ezdbfile_data (SHOW CREATE TABLE ezdbfile & SHOW CREATE TABLE ezdbfile_data).

I have a feeling you're missing the ON DELETE CASCADE trigger from ezdbfile => ezdbfile_data.

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Joël LEGER

Friday 28 August 2009 12:23:15 am

yes sure

settings/override/file.ini.append.php :

[ClusteringSettings]
FileHandler=eZDBFileHandler
DBBackend=eZDBFileHandlerMysqlBackend
DBHost=localhost
DBPort=3306
DBSocket=
DBName=client
DBUser=client
DBPassword=pasword
DBChunkSize=65535
DBConnectRetries=3
DBExecuteRetries=20

Tables definition :

CREATE TABLE `ezdbfile` (
`datatype` varchar(60) NOT NULL default 'application/octet-stream',
`name` text NOT NULL,
`name_trunk` text NOT NULL,
`name_hash` varchar(34) NOT NULL default '',
`scope` varchar(20) NOT NULL default '',
`size` bigint(20) unsigned NOT NULL,
`mtime` int(11) NOT NULL default '0',
`expired` tinyint(1) NOT NULL default '0',
PRIMARY KEY  (`name_hash`),
KEY `ezdbfile_name` (`name`(250)),
KEY `ezdbfile_name_trunk` (`name_trunk`(250)),
KEY `ezdbfile_mtime` (`mtime`),
KEY `ezdbfile_expired_name` (`expired`,`name`(250))
) ENGINE=InnoDB DEFAULT CHARSET=utf8


CREATE TABLE `ezdbfile_data` (
`name_hash` varchar(34) NOT NULL default '',
`offset` int(11) unsigned NOT NULL,
`filedata` blob NOT NULL,
PRIMARY KEY  (`name_hash`,`offset`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Bertrand Dunogier

Friday 28 August 2009 3:29:44 am

Yes, that's what I thought. There should be a trigger on ezdbfile_data: this trigger automatically deletes records in ezdbfile_data (blobs that are the actual content) when an entry is removed in ezdbfile.

This is what you should have get:

CREATE TABLE ezdbfile_data (
  name_hash VARCHAR(34)   NOT NULL DEFAULT '',
  offset    INT(11) UNSIGNED NOT NULL,
  filedata  BLOB          NOT NULL,
  PRIMARY KEY (name_hash, offset),
  CONSTRAINT ezdbfile_fk1 FOREIGN KEY (name_hash) REFERENCES ezdbfile (name_hash) ON DELETE CASCADE
) ENGINE=InnoDB;

To fix it, just drop the table and recreate it, or run this:

ALTER TABLE ezdbfile_data ADD CONSTRAINT ezdbfile_fk1 FOREIGN KEY (name_hash) REFERENCES ezdbfile (name_hash) ON DELETE CASCADE;

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

Joël LEGER

Monday 31 August 2009 7:00:26 am

thanks Bertrand for you feedback.

There is a sensitive problem :
There is data in the ezdbfile_data that i can't remove , do you think if i export data , remove the table, create the table with the constraint and import data again will be ok ?

Bertrand Dunogier

Monday 31 August 2009 7:27:34 am

Well, in any case, backup both tables somewhere. You never know. I hope you have enough disk space somewhere ;)

Then first try to add the constraint using the ALTER TABLE query. It should work, imho.

Then if this doesn't work, the cleanest way:
- unclusterize your cluster using php bin/php/clusterize.php -u
- drop & recreate the tables with the correct definition
- clusterize again (php bin/php/clusterize.php).

Bertrand Dunogier
eZ Systems Engineering, Lyon
http://twitter.com/bdunogier
http://gplus.to/BertrandDunogier

eZ debug

Timing: Jan 18 2025 05:18:03
Script start
Timing: Jan 18 2025 05:18:03
Module start 'content'
Timing: Jan 18 2025 05:18:03
Module end 'content'
Timing: Jan 18 2025 05:18:03
Script end

Main resources:

Total runtime0.8413 sec
Peak memory usage4,096.0000 KB
Database Queries211

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0065 587.6016180.8516
Module start 'content' 0.00650.7176 768.4531648.7344
Module end 'content' 0.72410.1172 1,417.1875341.0781
Script end 0.8413  1,758.2656 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00420.4940210.0002
Check MTime0.00160.1924210.0001
Mysql Total
Database connection0.00080.092510.0008
Mysqli_queries0.761990.55782110.0036
Looping result0.00190.22672090.0000
Template Total0.815596.920.4078
Template load0.00190.222520.0009
Template processing0.813696.710420.4068
Template load and register function0.00020.019910.0002
states
state_id_array0.00100.117810.0010
state_identifier_array0.00060.076920.0003
Override
Cache load0.00170.1963480.0000
Sytem overhead
Fetch class attribute can translate value0.00140.166740.0004
Fetch class attribute name0.00100.1234100.0001
XML
Image XML parsing0.00130.156940.0003
class_abstraction
Instantiating content class attribute0.00000.0028120.0000
General
dbfile0.00260.3136330.0001
String conversion0.00000.000630.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
8content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
5content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 39
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs