Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • erp5 erp5
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Merge requests 142
    • Merge requests 142
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedinexedi
  • erp5erp5
  • Merge requests
  • !1574

CMFActivity: simplify dependency query

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Vincent Pelletier requested to merge vpelletier/erp5:cmfactivity-simplify-dependency-query into master Mar 10, 2022
  • Overview 4
  • Commits 3
  • Pipelines 0
  • Changes 1

@Nicolas triggered a validation node SQL error while processing a large number of activities with very varied after_tag dependencies (1.8 distinct after_tag values per activity, which seems to me to be quite an extreme case):

ProgrammingError: (1064, "memory exhausted near [...]")

With the current setup of 3 activity tables, and a limit of 1k activities being checked at a time, this meant there were 5400 UNION-joined subqueries in the total query.

When this situation occurs, it completely blocks all activity validation until human intevention. This error comes from the InnoDB SQL grammar parser (yacc).

Restricting to less than 3k will reduce performance somewhat (by increasing the number of query) because it is very likely for to-validate activities to have at least one dependency (ideally very little above 1 on average) each, so the limit should be somewhere above 3k and below 5.4k. 5k is verified to work for this query structure, so it seems a reasonable limit.

/cc @jm

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: cmfactivity-simplify-dependency-query
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7