Skip to content

Support predis 2.* on cache RedisTagAwareAdapter #60050

Open
@BrianMwit

Description

@BrianMwit

Description

RedisTagAwareAdapter needs to handles Predis ReplicationInterface differently due to restricted sets of Redis command available

if ($host instanceof \Predis\Client && $host->getConnection() instanceof ReplicationInterface) {
// Predis supports info command only on the master in replication environments
$hosts = [$host->getClientFor('master')];
}

This was written and works in Predis v1. However, Predis\Connection\Aggregate\ReplicationInterface was moved to Predis\Connection\Replication\ReplicationInterface in v2, skipping this check, and cause cache writes to fail

This support for this issue has already been added to RedisTrait for RedisAdapter in #49238, #59751 - https://github.com/symfony/symfony/pull/59751/files#diff-38029e8e3e92a47fb8091876d3e8bc7fc61c2fc793cabf842ed933bf6985134c
Adding a similar fix on RedisTagAwareAdapter should be sufficient

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions