Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
erp5
Commits
0587079a
Commit
0587079a
authored
Jan 09, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Tolerate indexing an object whose path is "deleted" in the catalog.
parent
de98ee03
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
11 deletions
+17
-11
product/ERP5Type/tests/testCopySupport.py
product/ERP5Type/tests/testCopySupport.py
+0
-11
product/ZSQLCatalog/SQLCatalog.py
product/ZSQLCatalog/SQLCatalog.py
+17
-0
No files found.
product/ERP5Type/tests/testCopySupport.py
View file @
0587079a
...
...
@@ -86,23 +86,12 @@ class TestCopySupport(ERP5TypeTestCase):
self
.
assertTrue
(
person
.
getCareerSubordinationValue
().
aq_base
is
organisation
.
aq_base
)
def
test_02_unindexObjectDependency
(
self
):
# XXX This test passes for bad reasons.
person
=
self
.
portal
.
person_module
.
newContent
(
portal_type
=
'Person'
,
address_city
=
'Lille'
)
self
.
tic
()
person
.
recursiveReindexObject
()
person
.
default_address
.
setId
(
'old_address'
)
self
.
commit
()
# Currently, the test passes only because ActivityTool.distribute always
# iterates on queues in the same order: SQLQueue before SQLDict.
# If Python returned dictionary values in a different order,
# reindex activities would fail with the following error:
# uid of <Products.ERP5Catalog.CatalogTool.IndexableObjectWrapper for
# /erp5/person_module/1/old_address> is 599L and is already assigned
# to deleted in catalog !!! This can be fatal.
# This test would fail if:
# - SQLDict was used for 'unindexObject'
# - there were more than MAX_VALIDATED_LIMIT unindexed & reindexed objects
self
.
tic
()
def
test_03_unindexObjectGrouping
(
self
):
...
...
product/ZSQLCatalog/SQLCatalog.py
View file @
0587079a
...
...
@@ -1503,6 +1503,23 @@ class Catalog(Folder,
pass
finally
:
lock
.
release
()
elif
catalog_path
==
'deleted'
:
# Two possible cases:
# - Reindexed object's path changed (ie, it or at least one of its
# parents was renamed) but unindexObject was not called yet.
# Reindexing is harmelss: unindexObject and then an
# immediateReindexObject will be called.
# - Reindexed object was deleted by a concurrent transaction, which
# committed after we got our ZODB snapshot of this object.
# Reindexing is harmless: unindexObject will be called, and
# cannot be executed in parallel thanks to activity's
# serialisation_tag (so we cannot end up with a fantom object in
# catalog).
# So we index object.
# We could also not index it to save the time needed to index, but
# this would slow down all regular case to slightly improve an
# exceptional case.
pass
elif
catalog_path
is
not
None
:
# An uid conflict happened... Why?
# can be due to path length
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment