- 🇨🇳China zhangjy Dalian
It seems that we didn't implement tls connection for PhpRedis, and I found this Redis cluster not considering host protocol for masters
Now I work with the AWS ElasticCache Redis cluster, and Encryption in transit is enabled, so it needs to connect with TLS.I made a simple patch based on 2900947-57.patch →
Add the SSL context parameter
$client = new \RedisCluster($this->getClusterName(), $this->getSeeds(), $this->getTimeout(), $this->getReadTimeout(), $this->getPersistent(), $this->getPassword(), ['verify_peer' => false]);
Now I tested on AWS ElasticCache Redis cluster, it works good.
- 🇺🇸United States DigantDj
Patch #49 works fine for me until there's auto-scaling(adding shards) & slot redtribution. I understand with pipeline we will get MOVED server error, but is there a way to handle & retry this? Otherwise it defeats the purpose of going for Cluster Enabled Elasticache if we can't autoscale.
- Status changed to Needs work
almost 2 years ago 11:26pm 23 February 2023 - 🇨🇭Switzerland berdir Switzerland
#58 is a huge patch that seems to change file endings or so.
Can we convert this to a merge request? We have gitlab testing now and while the cluster integration won't be able to be tested there unless someone figures out how to set up a cluster with multiple redis docker services, it will at least help to make sure that no existing feature breaks.
-
+++ b/src/Cache/PredisClusterCacheTagsChecksum.php @@ -0,0 +1,33 @@ + public function invalidateTags(array $tags) { + $keys_to_increment = []; + foreach ($tags as $tag) { + // Only invalidate tags once per request unless they are written again. + if (isset($this->invalidatedTags[$tag])) { + continue; + } + $this->invalidatedTags[$tag] = TRUE; + unset($this->tagCache[$tag]); + $keys_to_increment[] = $this->getTagKey($tag); + } + if ($keys_to_increment) { + $pipe = $this->client->pipeline(); + foreach ($keys_to_increment as $key) {
why does this override invalidateTags() and not doInvalidateTags()? Is it possible this predates the refactoring that was done there?
-
+++ b/src/Controller/ReportController.php @@ -168,20 +169,19 @@ class ReportController extends ControllerBase { @@ -192,15 +192,19 @@ class ReportController extends ControllerBase { @@ -192,15 +192,19 @@ class ReportController extends ControllerBase { ], 'version' => [ 'title' => $this->t('Version'), - 'value' => $info['redis_version'] ?? $info['Server']['redis_version'], + 'value' => $info['redis_version'], + ], + 'mode' => [ + 'title' => $this->t('Mode'), + 'value' => Unicode::ucfirst($info['redis_mode']), ], 'clients' => [ 'title' => $this->t('Connected clients'), - 'value' => $info['connected_clients'] ?? $info['Clients']['connected_clients'], + 'value' => $info['connected_clients'],
this seems to revert a lot of changes that were done to handle different info structures. There's also a .rej and .org file in the patch.
-
+++ b/src/Flood/PredisCluster.php @@ -0,0 +1,11 @@ +/** + * Defines the database flood backend. This is the default Drupal backend. + */ +class PredisCluster extends Predis {
copy paste of an already wrong docblock?
-
- Assigned to acbramley
- Merge request !19Issue #2900947: Implement initial RedisCluster client integration → (Open) created by acbramley
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 1:55am 24 February 2023 - Status changed to Needs work
almost 2 years ago 2:34pm 24 February 2023 - 🇨🇭Switzerland berdir Switzerland
Hm, it might not run the test because you're not a maintainer, I can't really see a way in the UI to trigger it, clicking on run pipeline asks me but doesn't seem to do anything.
Posted review comments in gitlab.
- First commit to issue fork.
- 🇳🇱Netherlands spadxiii
I've added some functionality to allow setting of some options for both PhpRedisCluster and PredisCluster.
I was missing the 'scheme' option and the timeout options.As seen here, https://github.com/phpredis/phpredis/blob/develop/redis_cluster.stub.php..., the RedisCluster class allows for a context-array to be passed into the constructor. (It's not documented properly yet, and I can't find the issue I came across that mentions this method argument :) )
With my addition, it's possible to set the scheme to tls like so:
$settings['redis.connection']['scheme'] = 'tls';
The options `timeout` and `read_timeout` are also used. - 🇦🇺Australia acbramley
@SpadXIII the latest changes don't seem to match with what's allowing in the RedisCluster constructor.
public function __construct($name, $seeds, $timeout = null, $readTimeout = null, $persistent = false, $auth = null) {}
There's no parameter for an array of context values.
- 🇺🇸United States mihaic
Hi,
Both patches #57 or #58 are not applying any longer with the latest version of the module drupal/redis (1.7.0).
Is anyone else seeing the same ?
On a separate note, we are using this cluster implementation on production for more than 6 months and is working fine for us as per #57.
I encourage maintainers to commit this work so we avoid the hassle re-working this complex patch after every module update.
Thanks
- 🇦🇺Australia acbramley
Yes I agree with #69, we've been running this for a long time and the rerolls are getting quite difficult. It would be great if we could commit this in some form and open followup(s) for any remaining changes.
@Berdir - is there some compromise we can come to? What absolutely needs to be done before this gets committed?
- 🇭🇷Croatia milosr Croatia, Montenegro
The patch are not applying on the latest version of the module, we need to work on this.
- 🇮🇳India ajayNimbolkar
@mihaic
Can you please provide version of redis module used where patch #57 working fine.
- First commit to issue fork.
- 🇩🇪Germany Harlor Berlin
Caching with the new redis cluster implementation seems to work fine on our Drupal 10!
Only the recently added flush logic ( 🐛 Currently Drush Cr or Cache Clear UI does not flush Redis cache Fixed does not work. If I am not mistaken there are no databases in the cluster implementation - so the check for the database does not make sense for redis cluster right?
- 🇮🇹Italy matteo.fossen
Hi,
Since someone requested it, here's the latest patch - Status changed to Needs review
10 months ago 9:26pm 22 February 2024 - 🇦🇺Australia acbramley
This should have been set to NR again with the feedback addressed all the way back in Feb last year.
We have been running this patch for years at this point. If this can't be committed yet, can we please get a detailed list of steps to get it to a point where it can be?
- 🇧🇷Brazil jribeiro Campinas - São Paulo
We are using the following settings for our AWS ElasticCache Serverless (Cluster mode on) Redis with TLS enabled.
$settings['redis.connection']['interface'] = 'PhpRedisCluster'; $settings['redis.connection']['seeds'] = [ "{redis_host}:{redis_port}" ]; $settings['redis.connection']['scheme'] = 'tls';
It is working fine on our end.
- Status changed to Needs work
6 months ago 12:46am 11 June 2024 - 🇦🇺Australia acbramley
Again this is now heavily conflicting with more code committed to 8.x-1.x...
- Status changed to Needs review
4 months ago 10:20pm 18 August 2024 - 🇦🇺Australia acbramley
I've gone back through https://git.drupalcode.org/project/redis/-/commits/8.x-1.x/src/Controlle... and added all changes back to the ReportController instead of trying to fix the insane conflicts (due to the refactors to that controller on this branch).
If we can get this in without having to reroll again it would make my year 😅
- 🇬🇧United Kingdom vijaycs85 London, UK
Here is the re-roll of the MR against 1.8.
- 🇧🇷Brazil jribeiro Campinas - São Paulo
If you are using the failover patch ( https://www.drupal.org/node/3102739 → ) along with this change, apply the following patch.