Skip to content

[Cache] Support Redis Sentinel mode when using phpredis/phpredis extension #39363

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

[Cache] Support Redis Sentinel mode when using phpredis/phpredis extension #39363

wants to merge 3 commits into from

Conversation

renan
Copy link
Contributor

@renan renan commented Dec 7, 2020

Q A
Branch? 5.x
Bug fix? no
New feature? yes
Deprecations? no
Tickets Fix #39362
License MIT
Doc PR symfony/symfony-docs#14668

The version 5.2.0 of the Redis PHP extension, released back in March 2020, added support for Redis Sentinel mode with the help of the RedisSentinel class.

Usage of the Symfony/Cache RedisAdapter can continue to be the same, thus relying on the $options['redis_persistent'] option to both enable and define the master name.

@carsonbot
Copy link

Hey!

I see that this is your first PR. That is great! Welcome!

Symfony has a contribution guide which I suggest you to read.

In short:

  • Always add tests
  • Keep backward compatibility (see https://symfony.com/bc).
  • Bug fixes must be submitted against the lowest maintained branch where they apply (see https://symfony.com/releases)
  • Features and deprecations must be submitted against the 5.x branch.

Review the GitHub status checks of your pull request and try to solve the reported issues. If some tests are failing, try to see if they are failing because of this change.

When two Symfony core team members approve this change, it will be merged and you will become an official Symfony contributor!
If this PR is merged in a lower version branch, it will be merged up to all maintained branches within a few days.

I am going to sit back now and wait for the reviews.

Cheers!

Carsonbot

The version 5.2.0 of the [Redis PHP extension](http://pecl.php.net/package/redis), released back in March 2020, added support for Redis Sentinel mode with the help of the `RedisSentinel` class.

Usage of the `Symfony/Cache RedisAdapter` can continue to be the same, thus relying on the `$options['redis_persistent']` option to both enable and define the master name.
@renan renan changed the title Support Redis Sentinel mode when using phpredis/phpredis extension [Cache] Support Redis Sentinel mode when using phpredis/phpredis extension Dec 7, 2020
Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks! Here is some nitpicking.

@nicolas-grekas nicolas-grekas added this to the 5.x milestone Dec 8, 2020
@renan
Copy link
Contributor Author

renan commented Dec 8, 2020

@nicolas-grekas LGTM thanks! Here is some nitpicking.

Thank you for the feedback!

Not nitpicking at all. I've resolved them and added a fixup commit.

The failing Travis build is not related to my changes, perhaps you could retry it? I don't have the powerz! :P

@nicolas-grekas
Copy link
Member

Thank you @renan.

nicolas-grekas added a commit that referenced this pull request Dec 8, 2020
…s/phpredis extension (renan)

This PR was squashed before being merged into the 5.3-dev branch.

Discussion
----------

[Cache] Support Redis Sentinel mode when using phpredis/phpredis extension

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | no
| New feature?  | yes
| Deprecations? | no
| Tickets       | Fix #39362
| License       | MIT
| Doc PR        | symfony/symfony-docs#14668

The version 5.2.0 of the [Redis PHP extension](http://pecl.php.net/package/redis), released back in March 2020, added support for Redis Sentinel mode with the help of the `RedisSentinel` class.

Usage of the `Symfony/Cache RedisAdapter` can continue to be the same, thus relying on the `$options['redis_persistent']` option to both enable and define the master name.

Commits
-------

814ffab [Cache] Support Redis Sentinel mode when using phpredis/phpredis extension
@nicolas-grekas
Copy link
Member

I'm going to fix that inline, thanks for the notice.

@renan renan deleted the Feature-39362_ImplementRedisSentinelSupport branch December 8, 2020 11:18
nicolas-grekas added a commit that referenced this pull request Dec 10, 2020
… `\Redis` (ferrastas)

This PR was merged into the 5.3-dev branch.

Discussion
----------

[Cache] Make use of `read_timeout` in `\RedisSentinel` and `\Redis`

| Q             | A
| ------------- | ---
| Branch?       | 5.x
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #39429
| License       | MIT

This is a bugfix for #39363 a feature introduced in 5.x

As described in issue #39429, `\RedisSentinel` accepts an optional read timeout value during construction.
`read_timeout` is already part of the connection options, this PR just make use of it.

Commits
-------

14e36a2 [Cache] Make use of `read_timeout` in `\RedisSentinel` and `\Redis`
OskarStark added a commit to symfony/symfony-docs that referenced this pull request Jan 7, 2021
… extension (renan)

This PR was merged into the 5.3-dev branch.

Discussion
----------

Support Redis Sentinel mode when using phpredis/phpredis extension

See symfony/symfony#39363

Commits
-------

46d1f1a Support Redis Sentinel mode when using phpredis/phpredis extension
@fabpot fabpot mentioned this pull request Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Redis Sentinel mode when using phpredis/phpredis extension
3 participants