Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 139
    • Merge requests 139
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !895

Closed
Created Jun 19, 2019 by Vincent Pelletier@vpelletierOwner
  • Report abuse
Report abuse

Fix index/unindex race-condition

  • Overview 9
  • Commits 2
  • Changes 6

Warning: this merge request is based on commits already part of !893 (closed) . That merge request contains generic cleanups which are required for this approach, but also should be good independently from it.

This merge request contains the implementation-specific part, which require a decision on the way we want to go.

The issue is that if one deletes an object while it is being indexed (=indexation activity already running, and not finished yet), the unindexation activity will be able to immediately execute (the serialization_tag dependency is ignored, because the activity it depends on gets deleted by the object deletion code).

This fix just stops deleting activities when deleting a document: activity dependency becomes functional again, and catalog consistency is restored.

The last patch (testERP5Catalog: Test indexation/unindexation parallelism.) adds a test which fails on its very last assertion when ran before the fix (EPR5Type.CopySupport: Do not delete activities for deleted document.) and succeeds when ran after the fix, proving the current bug exists and that the fix actually fixes it.

testERP5Catalog: Check that deleting "a/b" then "a" unindexes both. is a test which works both before and after the fix, and which I think covers something which was not tested so far.

BusinessTemplate,TrashTool: Do not trigger (un)indexation when preserving/trimming subobjects. is required only if the main fix is applied (otherwise spawned activities get removed anyway) and only fixes the tip of the iceberg: updating/reinstalling a Business Template serialises & deserialises the same object multiple times. The ultimate fix should improve BT performance significantly (just because [de]serialisation is known to be slow), but I believe we do not care about this as another implementation is being worked on (?), and the changes required would likely be quite invasive.

/cc @seb @jerome @jm @yusei @romain

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: index_unindex_race_condition
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7