Over in #2966607: Invalidating 'node_list' and other broad cache tags early in a transaction severely increases lock wait time and probability of deadlock, discussion is being done regarding implementing a way to avoid deadlocks caused by invalidating cache tags. The same functionality will be needed on D7 to support the d8cache module.
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | interdiff_14-16.txt | 5.06 KB | poker10 |
| #16 | 3004437-16.patch | 6.46 KB | poker10 |
| #14 | reroll_diff_7-14.txt | 5.55 KB | ravi.shankar |
| #14 | 3004437-14.patch | 6.17 KB | ravi.shankar |
| #7 | 3004437-readd-rollback-api.patch | 6.24 KB | bdragon |
Issue fork drupal-3004437
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
bdragon commentedInitial version of patch based on Fabian's idea.
Comment #3
bdragon commentedInitial testing of this patch is being done with #3004429: Invalidate cache tags after transaction.
Comment #4
bdragon commentedComment #5
bdragon commentedUpdated patch to catch up with upstream.
More closely follow upstream patch.
Remove support for signaling on rollbacks.
It differs slightly from the D8 patch at the moment because it incorporates some future feedback that hasn't been posted to the D8 ticket yet.
Comment #6
fabianx commentedIs it a problem that now we can throw an Exception here -- while before this would not throw an Exception if the commit failed?
Comment #7
bdragon commentedGood point, making it do its own call to executeRootTransactionEndCallbacks() instead.
Patch updated again for readding the rollback root transaction calls. Additional call points identified.
Comment #8
fabianx commentedRTBC, but this needs to wait for the D8 issue to be in first.
Comment #9
joseph.olstadComment #10
mustanggb commentedComment #11
rosk0D8 patch landed.
Comment #12
mustanggb commentedComment #13
poker10 commentedAfter recent changes by #3185918: [PP-1] [PHP 8] Fix DatabaseConnection::query signature mismatch with PDO::query this patch no longer applies. It would need to be rerolled and checked.
Comment #14
ravi.shankar commentedAdded reroll of patch #7 on Drupal 7.x.
Comment #15
poker10 commentedThanks for the reroll @ravi.shankar, but is seems like the test for PostgreSQL and SQLite are failing (problems accessing the
parent::). It can be caused by the fact, that theDatabaseConnectionclass no longer extendsPDOclass after: #3185918: [PP-1] [PHP 8] Fix DatabaseConnection::query signature mismatch with PDO::query .Comment #16
poker10 commentedI have updated the patch with some changes (see interdiff) and compared it to the current D9 code (some minor changes).
1 - Removed the Callable type-hinting, because it has been introduced only in PHP 5.4 (and D7 should support also PHP 5.3), so I think we can live without that.
2 - Changed the order of
$this->connection->rollBack();and$this->executeRootTransactionEndCallbacks(FALSE);functions in the SQLite driver (on multiple places) - this should be the correct order (the same is also in the D9 code).3 - Fixed the
doCommit()function (problem with::parent, see the previous patch tests).Let's check the testbot now.
Comment #17
torgospizzaThere may be an issue in the patched code from this most recent patch,
includes/database/mysql/database.incin this block:Should
DatabaseConnection::doCommit()return $success at the end? Without it, the child classes are testing for$success = parent::doCommit())if in the middle of a transaction, but that parent function currently uses a void return value (due to there being no return statement).Comment #18
avpadernoIn
DatabaseConnection, the patch adds this code.In
DatabaseConnection_mysql, the code is changed as follows.$success = parent::doCommit();would just set$successtoNULL, sinceDatabaseConnection::doCommit()does not return any value.Comment #19
avpaderno