Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: redis/ioredis
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v4.27.1
Choose a base ref
...
head repository: redis/ioredis
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v4.27.2
Choose a head ref
  • 2 commits
  • 4 files changed
  • 2 contributors

Commits on May 3, 2021

  1. fix(cluster): avoid ClusterAllFailedError in certain cases

    Closes #1330
    
    Revert 8524eea. Before 4.24.1, ioredis asked cluster nodes for cluster slot information when connecting and periodically after connected. If all cluster nodes failed to provide the information (ex all nodes were down), ioredis would raise the "Failed to refresh slots cache" error and reconnect to the cluster (and print debug log Reset with [] ) if it hadn't connected, otherwise (when running periodically) it would just ignore.
    
    After 4.24.1, ioredis will raise and reconnect to the cluster even the cluster has already connected. This change is introduced to make failover detection faster.
    
    However, the commit causes `ClusterAllFailedError` in certain cases so we'll revert this and find other solutions.
    leibale authored May 3, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    aa9c5b1 View commit details

Commits on May 4, 2021

  1. chore(release): 4.27.2 [skip ci]

    ## [4.27.2](v4.27.1...v4.27.2) (2021-05-04)
    
    ### Bug Fixes
    
    * **cluster:** avoid ClusterAllFailedError in certain cases ([aa9c5b1](aa9c5b1)), closes [#1330](#1330)
    semantic-release-bot committed May 4, 2021
    Copy the full SHA
    e0cfea1 View commit details
Showing with 17 additions and 5 deletions.
  1. +7 −0 Changelog.md
  2. +8 −3 lib/cluster/index.ts
  3. +1 −1 package-lock.json
  4. +1 −1 package.json
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## [4.27.2](https://github.com/luin/ioredis/compare/v4.27.1...v4.27.2) (2021-05-04)


### Bug Fixes

* **cluster:** avoid ClusterAllFailedError in certain cases ([aa9c5b1](https://github.com/luin/ioredis/commit/aa9c5b1fee5daa24f35b3ff0d3556ecfb86db251)), closes [#1330](https://github.com/luin/ioredis/issues/1330)

## [4.27.1](https://github.com/luin/ioredis/compare/v4.27.0...v4.27.1) (2021-04-24)


11 changes: 8 additions & 3 deletions lib/cluster/index.ts
Original file line number Diff line number Diff line change
@@ -266,7 +266,14 @@ class Cluster extends EventEmitter {
this.once("close", closeListener);
this.once("close", this.handleCloseEvent.bind(this));

this.refreshSlotsCache();
this.refreshSlotsCache(
function (err) {
if (err && err.message === "Failed to refresh slots cache.") {
Redis.prototype.silentEmit.call(this, "error", err);
this.connectionPool.reset([]);
}
}.bind(this)
);
this.subscriber.start();
})
.catch((err) => {
@@ -513,8 +520,6 @@ class Cluster extends EventEmitter {
"Failed to refresh slots cache.",
lastNodeError
);
Redis.prototype.silentEmit.call(_this, "error", error);
_this.connectionPool.reset([]);
return wrapper(error);
}
const node = nodes[index];
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ioredis",
"version": "4.27.1",
"version": "4.27.2",
"description": "A robust, performance-focused and full-featured Redis client for Node.js.",
"main": "built/index.js",
"files": [