Discussion:
[Erp5-dev] refactoring the uid generation
Yoshinori Okuji
2005-05-18 17:56:08 UTC
Permalink
I have investigated some potential problems in uid generation, and solved them
mostly. Since this change is significant, be careful about making a backup
when you update your products.

Here is an upgrade path:

1. Make a backup. You should make a backup of all products and data for
safety. If this upgrade fails, your system will stop working.

2. Update all ERP5-related products. At least, ERP5Catalog and ZSQLCatalog
must be updated.

3. Recreate erp5_mysql in portal_catalog. The easiest way is 1) to rename
erp5_mysql to something else (e.g. erp5_mysql_backup) for safety, 2) to call
addDefaultSQLMethods from portal_catalog by just going to the URL
http://.../portal_catalog/addDefaultSQLMethods. This does not return
anything, but you should get a new erp5_mysql.

4. If you need to change the catalog methods or properties, do it now.

5. Clear the catalog.

6. Run ERP5Site_reindexAll. If you use portal_activities, make sure that
indexing is finished, before proceeding.

7. Again, clear the catalog.

8. Run ERP5Site_reindexAll. Likewise, make sure that all activities are
finished, before proceeding.

9. Check if everything looks good.

Double-reindexing is required, because uids might be reassigned in the first
indexing process.

If anything goes wrong, go back to the copy, and send a bug report to me.

YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Yoshinori Okuji
2005-05-18 18:03:19 UTC
Permalink
Post by Yoshinori Okuji
I have investigated some potential problems in uid generation, and solved
them mostly. Since this change is significant, be careful about making a
backup when you update your products.
1. Make a backup. You should make a backup of all products and data for
safety. If this upgrade fails, your system will stop working.
2. Update all ERP5-related products. At least, ERP5Catalog and ZSQLCatalog
must be updated.
2.5. Restart Zope.
Post by Yoshinori Okuji
3. Recreate erp5_mysql in portal_catalog. The easiest way is 1) to rename
erp5_mysql to something else (e.g. erp5_mysql_backup) for safety, 2) to
call addDefaultSQLMethods from portal_catalog by just going to the URL
http://.../portal_catalog/addDefaultSQLMethods. This does not return
anything, but you should get a new erp5_mysql.
4. If you need to change the catalog methods or properties, do it now.
5. Clear the catalog.
6. Run ERP5Site_reindexAll. If you use portal_activities, make sure that
indexing is finished, before proceeding.
7. Again, clear the catalog.
8. Run ERP5Site_reindexAll. Likewise, make sure that all activities are
finished, before proceeding.
9. Check if everything looks good.
Double-reindexing is required, because uids might be reassigned in the
first indexing process.
If anything goes wrong, go back to the copy, and send a bug report to me.
YO
YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Shrenik Bhura
2005-05-19 05:37:08 UTC
Permalink
Can these steps be followed on a system fired up using the livecd?

What method of installation would you recommend the most -
1. Doing a urpmi erp5 on a Mandrake 10.1 box
2. using the rc2 livecd
3. or following the steps given in the tutorial for installation.

-SB
Post by Yoshinori Okuji
Post by Yoshinori Okuji
I have investigated some potential problems in uid generation, and solved
them mostly. Since this change is significant, be careful about making a
backup when you update your products.
1. Make a backup. You should make a backup of all products and data for
safety. If this upgrade fails, your system will stop working.
2. Update all ERP5-related products. At least, ERP5Catalog and ZSQLCatalog
must be updated.
2.5. Restart Zope.
Post by Yoshinori Okuji
3. Recreate erp5_mysql in portal_catalog. The easiest way is 1) to rename
erp5_mysql to something else (e.g. erp5_mysql_backup) for safety, 2) to
call addDefaultSQLMethods from portal_catalog by just going to the URL
http://.../portal_catalog/addDefaultSQLMethods. This does not return
anything, but you should get a new erp5_mysql.
4. If you need to change the catalog methods or properties, do it now.
5. Clear the catalog.
6. Run ERP5Site_reindexAll. If you use portal_activities, make sure that
indexing is finished, before proceeding.
7. Again, clear the catalog.
8. Run ERP5Site_reindexAll. Likewise, make sure that all activities are
finished, before proceeding.
9. Check if everything looks good.
Double-reindexing is required, because uids might be reassigned in the
first indexing process.
If anything goes wrong, go back to the copy, and send a bug report to me.
YO
YO
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.tiolive.com/pipermail/erp5-dev/attachments/20050519/547bb576/attachment.htm>
Alexandre Boeglin
2005-05-20 16:36:00 UTC
Permalink
Post by Yoshinori Okuji
5. Clear the catalog.
Hello,

I'm affraid you forgot to commit the 'z_reserve_uid' ZSQL Method to CVS.

Regards,
Alex
Yoshinori Okuji
2005-05-20 17:06:23 UTC
Permalink
Post by Alexandre Boeglin
I'm affraid you forgot to commit the 'z_reserve_uid' ZSQL Method to CVS.
Thanks. I have fixed it right now.

YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Alexandre Boeglin
2005-05-24 11:35:28 UTC
Permalink
Post by Yoshinori Okuji
I have investigated some potential problems in uid generation, and
solved them mostly. Since this change is significant, be careful
about making a backup when you update your products.
Hello,

Here is another bug related to this change.

When you copy or delete elements from a ListBox, it always fails with
the message "Sorry your selection has changed".

So, I uncommented the log messages in SelectionTool, and here's what it
gives me :

##########################################
2005-05-24T11:05:46 INFO(0) selectionHasChanged, md5_string
8b411264fc92f0a3cfd207c7ac81fb19
------
2005-05-24T11:05:46 INFO(0) selectionHasChanged, object_uid_list
[1991716041]
------
2005-05-24T11:05:46 INFO(0) selectionHasChanged, new_md5_string
3f037fcf9e345fca99015bed3f75ef0d
------
2005-05-24T11:05:46 INFO(0) selectionHasChanged, return... True
##########################################

I wondered why the md5sum changes, as the uid is still correct, so here
are the tests I made :

##########################################
Post by Yoshinori Okuji
import md5
list = [1991716041]
md5.new(str(list)).hexdigest()
'3f037fcf9e345fca99015bed3f75ef0d'
Post by Yoshinori Okuji
list = [1991716041L]
md5.new(str(list)).hexdigest()
'8b411264fc92f0a3cfd207c7ac81fb19'
##########################################

So the problem is that once, the uid is treated as as long, and the
second time, it is treated as an int.

My first guess on how to fix it is to make functions like getUid always
return a long value, but it doesn't sound like a seamless change to
do ...

Any comments ?


Regards,
Alex
Yoshinori Okuji
2005-05-24 12:40:43 UTC
Permalink
Post by Alexandre Boeglin
My first guess on how to fix it is to make functions like getUid always
return a long value, but it doesn't sound like a seamless change to
do ...
Thank you for your report. I have fixed it right now.

YO
--
Yoshinori Okuji, Nexedi Research Director
Nexedi: Consulting and Development of Free / Open Source Software
http://www.nexedi.com
ERP5: Free / Open Source ERP Software for small and medium companies
http://www.erp5.org
Storever: OpenBrick, WiFi infrastructure, notebooks and servers
http://www.storever.com
Loading...