Clustering and ezdbfile name

Author Message

Carlos Revillo

Thursday 05 June 2008 1:40:35 am

Hello.
We're working in a clustering environment for ez 3.9.2, so we've followed the steps shown at
http://ez.no/doc/ez_publish/technical_manual/3_9/features/clustering/setting_it_up

All works quite well, but we're having problems with the name file in ezdbfile table created.

Looking at definition of the tables suggested we can see

CREATE TABLE ezdbfile (
  id        MEDIUMINT(8) UNSIGNED NOT NULL auto_increment,
  datatype  VARCHAR(60)  NOT NULL DEFAULT 'application/octet-stream',
  name      VARCHAR(255) NOT NULL DEFAULT '',
  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',
  PRIMARY KEY (id),
  UNIQUE INDEX ezdbfile_name (name),
  UNIQUE INDEX ezdbfile_name_hash (name_hash)
) ENGINE=InnoDB;

but this limits the length of the name files to only 255 characters. We have a contentstructure with several levels, and this levels have long names. The result is that we have file images name for about 280 and maybe 300 characters. So, this names are not entirely recorded and the db, and that's because we're thinking we're having problems with several images.

So, is there any workaround for this? We have reading we can define a bigger varchar field and mysql will convert it to another type, but anyone knows if this could cause any kind of problems?

Thank you.

Bruce Morrison

Thursday 05 June 2008 2:20:59 am

Hi Carlos

I've been running a clustered site for quite a while and can't say I've noticed any trouble with the length of this field.

I've just checked and there does appear be be some entries that are at the 255 char limit and truncated. I'll have to check that out!

I did find that there was an issue with the size of the "id" field in that we ran out of id's. When mysql gets to a limit of the auto increment field inserts fail. To solve ezdbfile.id & ezdbfile_data.id & ezdbfile_data.masterid where all changed to bigint(20) unsigned.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Carlos Revillo

Thursday 05 June 2008 2:27:17 am

Thanks so much for your reply.

I think we still haven't this issue with medium int but is good to know. We have clusterized this installation yesterday and we haven't any problems with the insertion of the files. All files seems to be in the ezdbfile table, but, as i said before, some of their names are truncated.

i'll let you know about. thanks.

Gaetano Giunta

Thursday 05 June 2008 2:28:42 pm

If you're running on mysql 5.0.3+, you can up the size of the name field to 65535 (a little bit less, actually: that's max length for the whole row, so you have to subtract the other fields length).

On mysql 5.0.2-, max length for a varchar filed is sadly 255 chars.
In oracle it is btw 4000. And in postgres "something less than 1 GB". Hard to pick a long-enough value that would suit all implementations...

Principal Consultant International Business
Member of the Community Project Board

Carlos Revillo

Monday 09 June 2008 12:57:59 pm

Thanks. we're working with mysql 5.0.55.
we've altered this mysql script to create that name field as TEXT and not varchar. all works well now.

Btw, we we're talking with ez crew and they say to us that upgrading to 3.10 will be better for clustering.

thanks everybody.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.