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.
If I define multiple replica set servers in mongo connections settings mdbc will choke and die trying to connect to "192.168.0.1,192.168.0.2" if replica set option is enabled drush should figure out which is primary and connect to that one by default and also allow option for user to connect to any of the secondaries.
Comment | File | Size | Author |
---|---|---|---|
#13 | 1823478-replicasets_connection-13.patch | 6.27 KB | fgm |
#11 | 1823478-replica_sets-11.patch | 6.6 KB | fgm |
#9 | mdbc_replica-2823478-9.patch | 6.54 KB | alasda |
#8 | mdbc_replica-1823478-8.patch | 6.01 KB | alasda |
#7 | drush_command_line-1823478-7.patch | 7.29 KB | disasm |
Comments
Comment #1
Rok Žlender CreditAttribution: Rok Žlender commentedPatch supports running drush command on replica set configuration options.
Comment #2
Rok Žlender CreditAttribution: Rok Žlender commentedRevisited patch created new constant for primary member status value and added a msg to users when connecting to secondary how to send queries against it.
Comment #3
fgmPatch no longer applies, so setting CNW. This is not just a matter of rerolling : the connection process changed in 3 years.
At this point, drush mdbc does not even work on a standalone host.
Comment #5
fgmThe commit above restores mdbc and the other drush operations on single hosts : the patch is still needed for replicasets.
Comment #6
fgmThe connection string issue with authenticated users had another partial patch on #1930822: drush mongo shell host scheme error, probably good to merge with this one.
Comment #7
disasm CreditAttribution: disasm at AppliedTrust commentedI ended up rerolling this to get it to work with mongo 3.x client which no longer likes the old ; separated params. Here's a patch.
Comment #8
alasda CreditAttribution: alasda commentedRolls together Rok Zlender and disam's patches against current head. Fixes a few formatting and coding standards issues.
Comment #9
alasda CreditAttribution: alasda commentedFixes a couple missed formatting issues from previous patch.
Comment #10
marcingy CreditAttribution: marcingy at Examiner.com commentedComment #11
fgmPatch no longer applied : rerolled on today's HEAD for review.
Comment #12
fgmAny reason to wrap this on a single too long line ? I find it less readable, and if kept, the array needs to be multiline anyway, as per coding standards.
The whole code in this function is replicating/replacing code from the mongodb() function in the main module, but missing some functionality like supporting debug and returning MongoDummy on failures. We should not have two different connection methods : if the RS support in this method is better than the one in mongodb(), it needs to be merged there, not duplicated here.
Seeing the code on the next lines, "lets" should probably be "then" ? As such, the sentence is not clear
This constant is not used anywhere, so it should probably be removed.
This constant looks like it has a typo, and it is used as MONGODB_SLAVE_NOT_CONNECTED, not with the typo, so it needs to be changed.
Comment #13
fgmRerolled on top of today's HEAD, also addressing all points except 2.
Comment #14
fgmAlso, note that this patch will need to be compatible with #2644482: PHP 7 driver support, which may have consequences since the parsing of connection strings may be different between the legacy mongo extension used by this version of the patch, and the current mongodb extension used with PHP 7 and earlier versions of PHP with the alcaeus adapter.
Comment #15
fgmPR is on https://github.com/fgm/mongodb/pull/65