Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Need support for locking framework
Comment | File | Size | Author |
---|---|---|---|
#20 | 0001-Issue-1180056-by-crea-donquixote-Add-a-MongoDB-lock-.patch | 11.7 KB | fgm |
#18 | mongodb-7.x-1.x-1180056-17.patch | 11.11 KB | donquixote |
#7 | mongodb_lock_1180056_7.patch | 10.84 KB | crea |
#2 | mongodb_lock_1180056.patch | 9.11 KB | crea |
Comments
Comment #1
crea CreditAttribution: crea commentedComment #2
crea CreditAttribution: crea commentedFirst version for D6.
Comment #3
crea CreditAttribution: crea commentedWe could also use MongoId($name) as an _id
Comment #4
crea CreditAttribution: crea commentedNeed progressing lock_wait() like in the Memcache module
Comment #5
crea CreditAttribution: crea commentedComment #6
crea CreditAttribution: crea commentedComment #7
crea CreditAttribution: crea commentedUpdated patch. Added variable collection names. Borrowed progressive lock_wait() implementation from Memcache project and also included configurable sleep intervals.
Comment #8
crea CreditAttribution: crea commentedLooks like using safe updates was not good idea because MongoDB syncs that to disk...But can we use it without safe option at all ? We need to be sure about the lock.
Comment #9
crea CreditAttribution: crea commentedI wasn't paying attention. There's a separate fsync option
Comment #10
crea CreditAttribution: crea commentedComment #11
fgmFour years later and no committed version, can we agree to close this and say there will never be a stable 6.x version for lock ?
Comment #12
slashrsm CreditAttribution: slashrsm as a volunteer commentedAgreed. If there is still anyone out there that needs this feel free to reopen and bring patch to RTBC state. Maintainers will be happy to commit it in that case.
Comment #13
donquixote CreditAttribution: donquixote commentedI think it makes sense to reopen this for D7.
After doing some other optimizations, the remaining sources of slow queries when flushing caches are
lock_acquire()
,lock_release()
andvariable_set()
. Migrating this stuff to MongoDB probably helps.(fyi I just started playing with MongoDB today, so maybe it will take a while until I actually write a patch)
Comment #14
donquixote CreditAttribution: donquixote commentedComment #15
donquixote CreditAttribution: donquixote commentedI am trying to port this to D7.
One thing I run into is this:
According to http://php.net/manual/de/mongo.writeconcerns.php
and
See also http://php.net/manual/de/mongo.writeconcerns.php
I assume this means I can totally omit the 'safe' => 1, because the 'w' is already on 1 by default.
Can someone confirm this?
Comment #16
donquixote CreditAttribution: donquixote commentedAnother question is whether this really needs to be a separate submodule, or if it is sufficient to just have the include file, like in memcache-lock.inc and memcache-lock-code.inc.
Comment #17
fgmActually, any operation should use the settings from the connection, and in most cases only override them in a way that can be configured, so it doesn't seem to make much sense to hardcode a write concern like this, be it the old way (safe) or the new one (w, j).
Regarding the "submodule", I think the main reason for having them is to keep each concern in its own "area" using directories. One small thing, by the way : I would prefer you to use .php files rather than .inc in future code, so they can be included in the Scrutinizer checks. And PSR-4 if there are classes : there is already a PSR-4 autoloader in one of the current issues/branches, which is likely to help when we'll tackle D8.
Comment #18
donquixote CreditAttribution: donquixote commentedJust so we have a new starting point for further work on this.
Or maybe it is already good this way :)
I am running this locally and have not seen any issues, but I don't really know what to look for.
The D6 patch from #7 applied cleanly to D7 (because it was all about adding files), so I started with that.
Further changes can be seen on github,
https://github.com/donquixote/drupal-mongodb/compare/7.x-1.x...7.x-1.x-l...
Comment #19
fgmGood to have a starting point. It will need tests, of course : you can look at the way to have usable tests for MongoDB with Simpletest in the recently updated submodules as well as the yet unmerged path plugin issue.
Comment #20
fgmRerolled on today's 7.x-1.x HEAD. Still needs improvements though. At a minimum:
* Update the README.md
* Provide tests, probably by wrapping the core tests just like the cache plugin does.
Comment #21
fgmPR is on https://github.com/fgm/mongodb/pull/66