Skip to content

refactor: limit info on readyCheck to persistence section - #1293

Closed
ejose19 wants to merge 1 commit into
redis:masterfrom
ejose19:ej/adjustReadyCheck
Closed

ejose19 wants to merge 1 commit into
redis:masterfrom
ejose19:ej/adjustReadyCheck

Conversation

@ejose19

@ejose19 ejose19 commented Mar 4, 2021 •

Copy link
Copy Markdown

Related: #1211

Limits the info call on readyCheck to just persistence section, allowing users to specify the exact acl (+info|persistence) that ioredis needs on readyCheck

@ejose19
ejose19 force-pushed the ej/adjustReadyCheck branch 2 times, most recently from f52f099 to 64203b3 Compare March 4, 2021 22:36

@luin luin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is dump.rdb necessary?

@ejose19
ejose19 force-pushed the ej/adjustReadyCheck branch from 64203b3 to 11e86cb Compare March 6, 2021 04:36
@ejose19

ejose19 commented Mar 6, 2021

Copy link
Copy Markdown
Author

@luin not really, didn't notice that file. Should be good now.

@ejose19
ejose19 force-pushed the ej/adjustReadyCheck branch from 11e86cb to 7ec0257 Compare March 6, 2021 04:45
@ejose19
ejose19 requested a review from luin March 9, 2021 20:09
@luin luin mentioned this pull request Feb 6, 2022
8 tasks done
@marcbachmann

Copy link
Copy Markdown
Collaborator

@luin

luin commented Feb 20, 2022

Copy link
Copy Markdown
Collaborator

Turns out Sentinel connector uses the role field which is under the replication section: https://github.com/luin/ioredis/blob/5cd4f57/lib/connectors/SentinelConnector/index.ts#L74. So a couple of ideas:

  1. Just don't do anything. If the user doesn't have permission to run info, they can disable the ready check as a workaround.
  2. Only provide presistence in the standalone mode, and run without arguments in the sentinel mode.

Not sure which one is the best. I'd prefer 1 but maybe we can catch the NOPERM error and print a hint to tell users they can disable the ready check.

Maybe we could also remove client.serverInfo completely

Yeah we can remove it.

luin added a commit that referenced this pull request Feb 28, 2022
Closes #1293

BREAKING CHANGE: `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
luin added a commit that referenced this pull request Feb 28, 2022
Closes #1293

BREAKING CHANGE: `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
@luin luin closed this in 5b7a87d Feb 28, 2022
github-actions Bot pushed a commit that referenced this pull request Mar 14, 2022
# [5.0.0-main.1](v4.28.5...v5.0.0-main.1) (2022-03-14)

### Bug Fixes

* add @ioredis/interface-generator to dev deps ([f345b27](f345b27))
* add the missing typing for Redis#call() ([1e79ead](1e79ead))
* better support for CJS importing ([e6a49c4](e6a49c4))
* disable slotsRefreshInterval by default ([d24676c](d24676c))
* Fix the NOSCRIPT behavior when using pipelines ([39b3c51](39b3c51))
* improve typing for auto pipelining ([c8ec91a](c8ec91a))
* improve typing for pipeline ([379327b](379327b))
* make fields private when possible ([f7d03e1](f7d03e1))
* parameter declaration of Redis#duplicate ([95eaf61](95eaf61))
* remove dropBufferSupport option ([60a6d00](60a6d00))
* remove unused Command#isCustomCommand ([c8794d3](c8794d3))
* rename interfaces by dropping prefix I ([5cd4f57](5cd4f57))
* Reset loaded script hashes to force a reload of scripts after reconnect of redis ([8dd3591](8dd3591))
* support passing keyPrefix via redisOptions ([5101581](5101581))

### Features

* add [@SInCE](https://github.com/since) to method comments ([88729da](88729da))
* add declarations for methods ([bd920b3](bd920b3))
* add tests for cluster ([e1cd0cf](e1cd0cf))
* always parse username passed via URI ([3d5519b](3d5519b))
* drop support of Node.js 10 ([9d1977d](9d1977d))
* drop support of third-party Promise libraries ([62a197f](62a197f))
* expose official declarations ([e0f24e6](e0f24e6))
* improve typings for cluster ([5aa3f98](5aa3f98))
* improve typings for pipeline ([d8b9efc](d8b9efc))
* improve typings for transformers ([1cf58e7](1cf58e7))
* Pipeline-based script loading ([63dc0f4](63dc0f4))
* Refactor code with modern settings ([29b28a3](29b28a3))
* skip ready check on NOPERM error ([5b7a87d](5b7a87d)), closes [#1293](#1293)
* support commands added in Redis v7 ([69a0e1b](69a0e1b))
* support defining custom commands via constructor options ([65082d6](65082d6))
* support Redis Functions introduced in Redis 7.0 ([6cab03a](6cab03a))

### BREAKING CHANGES

* `slotsRefreshInterval` is disabled by default,
previously, the default value was 5000.
* `allowUsernameInURI` is removed and ioredis will always
use the username passed via URI.

Previously, the `username` part in `new Redis("redis://username:[email protected]:6380/4")`
was ignored unless `allowUsernameInURI` is specified: `new Redis("redis://username:[email protected]:6380/4?allowUsernameInURI=true")`.

Now, if you don't want to send username to Redis, just leave the username part empty:
`new Redis("redis://:[email protected]:6380/4")`
* `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
* Related methods are kept but they don't take any effects.

The native Promise will always be used.
* 1. We now require Node.js v10.12.0 or newer.
2. We now only work with Redis v3.0.0 or newer.
3. `Redis` can't be called as a function anymore as it's now a class.
Please change `Redis()` to `new Redis()`. Note that `Redis()` was already deprecated
in the previous version.
luin added a commit that referenced this pull request Mar 14, 2022
Closes #1293

BREAKING CHANGE: `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
github-actions Bot pushed a commit that referenced this pull request Mar 14, 2022
# [5.0.0-beta.1](v4.28.5...v5.0.0-beta.1) (2022-03-14)

### Bug Fixes

* add @ioredis/interface-generator to dev deps ([aa3b3e9](aa3b3e9))
* add the missing typing for Redis#call() ([747dd30](747dd30))
* better support for CJS importing ([687d3eb](687d3eb))
* disable slotsRefreshInterval by default ([370fa62](370fa62))
* Fix the NOSCRIPT behavior when using pipelines ([bc1b168](bc1b168))
* improve typing for auto pipelining ([4e8c567](4e8c567))
* improve typing for pipeline ([d18f3fe](d18f3fe))
* make fields private when possible ([d5c2f20](d5c2f20))
* parameter declaration of Redis#duplicate ([a29d9c4](a29d9c4))
* remove dropBufferSupport option ([04e68ac](04e68ac))
* remove unused Command#isCustomCommand ([46ade6b](46ade6b))
* rename interfaces by dropping prefix I ([d1d9dba](d1d9dba))
* Reset loaded script hashes to force a reload of scripts after reconnect of redis ([60c2af9](60c2af9))
* support passing keyPrefix via redisOptions ([6b0dc1e](6b0dc1e))

### Features

* add [@SInCE](https://github.com/since) to method comments ([13eff8e](13eff8e))
* add declarations for methods ([1e10c95](1e10c95))
* add tests for cluster ([1eba58b](1eba58b))
* always parse username passed via URI ([c6f41f6](c6f41f6))
* drop support of Node.js 10 ([f9a5071](f9a5071))
* drop support of third-party Promise libraries ([2001ec6](2001ec6))
* expose official declarations ([7a436b1](7a436b1))
* improve typings for cluster ([06782e6](06782e6))
* improve typings for pipeline ([334242b](334242b))
* improve typings for transformers ([94c1e24](94c1e24))
* Pipeline-based script loading ([8df6ee2](8df6ee2))
* Refactor code with modern settings ([a8ffa80](a8ffa80))
* skip ready check on NOPERM error ([b530a0b](b530a0b)), closes [#1293](#1293)
* support commands added in Redis v7 ([53ca412](53ca412))
* support defining custom commands via constructor options ([f293b97](f293b97))
* support Redis Functions introduced in Redis 7.0 ([32eb381](32eb381))

### BREAKING CHANGES

* `slotsRefreshInterval` is disabled by default,
previously, the default value was 5000.
* `allowUsernameInURI` is removed and ioredis will always
use the username passed via URI.
Previously, the `username` part in `new Redis("redis://username:[email protected]:6380/4")`
was ignored unless `allowUsernameInURI` is specified: `new Redis("redis://username:[email protected]:6380/4?allowUsernameInURI=true")`.
Now, if you don't want to send username to Redis, just leave the username part empty:
`new Redis("redis://:[email protected]:6380/4")`
* `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
* Support for third-party Promise libraries is dropped. Related methods (`exports.Promise = require('bluebird')`) are kept but they don't take any effects. The native Promise will always be used.
* We now require Node.js v10.12.0 or newer.
* We now only work with Redis v3.0.0 or newer.
* `Redis` can't be called as a function anymore as it's now a class.
Please change `Redis()` to `new Redis()`. Note that `Redis()` was already deprecated
in the previous version.
@github-actions

Copy link
Copy Markdown

🎉 This issue has been resolved in version 5.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions Bot pushed a commit that referenced this pull request Mar 26, 2022
# [5.0.0](v4.28.5...v5.0.0) (2022-03-26)

### Bug Fixes

* add @ioredis/interface-generator to dev deps ([aa3b3e9](aa3b3e9))
* add missing declaration for callBuffer ([08c9072](08c9072))
* add the missing typing for Redis#call() ([747dd30](747dd30))
* better support for CJS importing ([687d3eb](687d3eb))
* disable slotsRefreshInterval by default ([370fa62](370fa62))
* Fix the NOSCRIPT behavior when using pipelines ([bc1b168](bc1b168))
* improve typing for auto pipelining ([4e8c567](4e8c567))
* improve typing for pipeline ([d18f3fe](d18f3fe))
* keyPrefix should work with Buffer ([6942cec](6942cec)), closes [#1486](#1486)
* make fields private when possible ([d5c2f20](d5c2f20))
* parameter declaration of Redis#duplicate ([a29d9c4](a29d9c4))
* pipeline fails when cluster is not ready ([af60bb0](af60bb0)), closes [#1460](#1460)
* remove dropBufferSupport option ([04e68ac](04e68ac))
* remove unused Command#isCustomCommand ([46ade6b](46ade6b))
* rename interfaces by dropping prefix I ([d1d9dba](d1d9dba))
* Reset loaded script hashes to force a reload of scripts after reconnect of redis ([60c2af9](60c2af9))
* support passing keyPrefix via redisOptions ([6b0dc1e](6b0dc1e))

### Features

* add [@SInCE](https://github.com/since) to method comments ([13eff8e](13eff8e))
* add declarations for methods ([1e10c95](1e10c95))
* add tests for cluster ([1eba58b](1eba58b))
* always parse username passed via URI ([c6f41f6](c6f41f6))
* drop support of Node.js 10 ([f9a5071](f9a5071))
* drop support of third-party Promise libraries ([2001ec6](2001ec6))
* expose official declarations ([7a436b1](7a436b1))
* improve typings for cluster ([06782e6](06782e6))
* improve typings for pipeline ([334242b](334242b))
* improve typings for smismember ([487c3a0](487c3a0))
* improve typings for transformers ([94c1e24](94c1e24))
* improve typings for xread ([96cc335](96cc335))
* Pipeline-based script loading ([8df6ee2](8df6ee2))
* prepare v5 stable release ([#1538](#1538)) ([fe32ce7](fe32ce7))
* Refactor code with modern settings ([a8ffa80](a8ffa80))
* skip ready check on NOPERM error ([b530a0b](b530a0b)), closes [#1293](#1293)
* support commands added in Redis v7 ([53ca412](53ca412))
* support defining custom commands via constructor options ([f293b97](f293b97))
* support Redis Functions introduced in Redis 7.0 ([32eb381](32eb381))

### BREAKING CHANGES

* `slotsRefreshInterval` is disabled by default,
previously, the default value was 5000.
* `allowUsernameInURI` is removed and ioredis will always
use the username passed via URI.
Previously, the `username` part in `new Redis("redis://username:[email protected]:6380/4")`
was ignored unless `allowUsernameInURI` is specified: `new Redis("redis://username:[email protected]:6380/4?allowUsernameInURI=true")`.
Now, if you don't want to send username to Redis, just leave the username part empty:
`new Redis("redis://:[email protected]:6380/4")`
* `Redis#serverInfo` is removed. This field is never documented so
you very likely have never used it.
* Support for third-party Promise libraries is dropped. Related methods (`exports.Promise = require('bluebird')`) are kept but they don't take any effects. The native Promise will always be used.
* We now require Node.js v10.12.0 or newer.
* We now only work with Redis v3.0.0 or newer.
* `Redis` can't be called as a function anymore as it's now a class.
Please change `Redis()` to `new Redis()`. Note that `Redis()` was already deprecated
in the previous version.
@github-actions

Copy link
Copy Markdown

🎉 This issue has been resolved in version 5.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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.

3 participants