• Hi there,

    I recently migrated our Redis instance to AWS Elasticache Serverless and noticed that wp_cache_flush_group no longer works. It’s not a huge issue as we put excluded the group in question from persistent storage and it suits our needs for now, but I wanted to flag this as a potential issue.

    If there is any Redis CLI command or script you would like me to run to help troubleshoot, please let me know.

    Cheers!
    Alex

Viewing 3 replies - 16 through 18 (of 18 total)
  • Thread Starter alexl75

    (@alexl75)

    @tillkruess got it. Weird that everything still seems to work properly with WP_REDIS_HOST. I opened a ticket with AWS to figure out the cluster endpoints to use. I’ll follow up once I have a response.

    Thread Starter alexl75

    (@alexl75)

    @tillkruess I got back on this today. I finally figured out that the cluster mode doesn’t pass through SSL options and this is why I was having issues.

    I updated this block to look like this (bolded parts new):

    $args = [
        'cluster' => $this->build_cluster_connection_array(),
        'timeout' => $parameters['timeout'],
        'read_timeout' => $parameters['read_timeout'],
        'persistent' => $parameters['persistent'],
        'password' => null,
        'ssl' => null,
    ];
    
    if ( isset( $parameters['password'] ) && version_compare( $version, '4.3.0', '>=' ) ) {
        $args['password'] = $parameters['password'];
    }
    
    if ( defined('WP_REDIS_SSL_CONTEXT')) {
        $args['ssl'] = WP_REDIS_SSL_CONTEXT;
    }

    I’m now running this config and can run in cluster mode successfully:

    define('WP_REDIS_CLIENT', 'phpredis');
    define('WP_REDIS_CLUSTER', [
      'tls://' . getenv('WP_REDIS_HOST') . ':6379?alias=node-01',
    ]);
    define('WP_REDIS_SSL_CONTEXT', [
      'verify_peer' => false,
    ]);

    However wp_cache_flush_group('transient') for instance still returns false.

    Plugin Author Till Krüss

    (@tillkruess)

    Aha! Would you be up for opening a PR on GitHub, so it’s merged?

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘Group flush not working on AWS Elasticache Serverless’ is closed to new replies.