Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5
erp5
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Merge Requests 110
    • Merge Requests 110
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Jobs
  • Commits
  • nexedi
  • erp5erp5
  • Merge Requests
  • !1095

Closed
Opened Apr 03, 2020 by Kirill Smelkov@kirr
  • Report abuse
Report abuse

ERP5Type/patches/ZODBConnection: Don't duplicate code from ZODB.Connection.newTransaction

Commit c663257f (Commit fix done by Julien and Leonardo) added network barrier into ZODB.Connection.newTransaction to fix issues when activity node A1 was woken up by message from another activity node A2 through SQL, but A1's ZODB view was not yet updated with changes committed by A2.

That fix prepended ping call before original newTransaction actions, but instead of tailing to original ZODB newTransaction after the ping, it copied newTransaction code from ZODB.

Today this can cause the following problems:

  1. the code that was copied is valid only for ZODB3 and ZODB4, but is not valid for ZODB5 as that place was changed by upstream:

    https://github.com/zopefoundation/ZODB/blob/5.5.1-56-gbb9bf5393/src/ZODB/Connection.py#L734-L742

  2. wendelin.core 2 relies on patching ZODB.Connection.newTransaction further to install "Connection.onResyncCallback" functionality to keep ZODB and WCFS connections in sync:

    https://lab.nexedi.com/kirr/wendelin.core/blob/25c3184d/lib/zodb.py#L264-291

    So if ERP5Type.patches is imported after wendelin.lib.zodb, the functionality installed by wendelin.core will be lost.

-> Fix both issues by avoiding code duplication and just tailing to original ZODB newTransaction after the ping.

Note: this commit is not enough to fully support ZODB5, since ping() must also be updated.

/cc @seb, @jm, @vpelletier, @romain

Edited Apr 07, 2020 by Kirill Smelkov

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch https://lab.nexedi.com/kirr/erp5.git y/zodb-newTxn-nodup
git checkout -b kirr/erp5-y/zodb-newTxn-nodup FETCH_HEAD

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git fetch origin
git checkout origin/master
git merge --no-ff kirr/erp5-y/zodb-newTxn-nodup

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 10
  • Commits 1
  • Changes 1
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: nexedi/erp5!1095
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备14008524号