Skip to content
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

feat(experimental): Basic implementation for the Redis Cluster client #235

Merged
merged 64 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
cdedf0e
WIP: Basic implementation for Redis Cluster client
uki00a Jun 24, 2021
9f2132c
chore: Fix typo
uki00a Jun 24, 2021
05baa00
fix: Update
uki00a Jun 26, 2021
2aebae7
test: Try to add tests for DEL command
uki00a Jul 4, 2021
d160c8a
chore: Ignore tests/server directory
uki00a Jul 4, 2021
db2b2d5
chore: Fix
uki00a Jul 4, 2021
004070a
chore: Fix comment
uki00a Jul 4, 2021
7586b06
test: Try to setup Redis Cluster using redis-cli
uki00a Jul 5, 2021
25386e8
chore: Fixed lint
uki00a Jul 5, 2021
29ec721
ci: Allow Deno to run 'redis-cli'
uki00a Jul 5, 2021
ecaafbb
test: Failed to setup redis cluster...
uki00a Jul 5, 2021
ae84469
test: Improve error message
uki00a Jul 5, 2021
30b95e2
test: Try to wait for servers to start up
uki00a Jul 5, 2021
d23e2ec
fix: Update .gitignore
uki00a Jul 5, 2021
b22b839
test: Update cluster client tests
uki00a Jul 5, 2021
3c1125e
chore: Debug
uki00a Jul 5, 2021
39f510a
chore: Debug (part 2)
uki00a Jul 5, 2021
dbeb56f
chore: Lint
uki00a Jul 5, 2021
8ead7c5
test: Update cluster-config-file
uki00a Jul 5, 2021
b4e1174
test: Update cluster-conf-file (part 2)
uki00a Jul 5, 2021
0850c5e
test: Remove debugging related stuff
uki00a Jul 5, 2021
2107ec6
test: Temporary disable all tests except those for redis cluster
uki00a Jul 5, 2021
cfcd206
chore: Lint
uki00a Jul 5, 2021
c0353f1
test: Add delay
uki00a Jul 7, 2021
8fb8d4a
test: Add "--cluster-yes" option
uki00a Jul 7, 2021
37fbc26
chore: Lint
uki00a Jul 7, 2021
fac2172
test: Re-add delay
uki00a Jul 7, 2021
b33c357
fix: Fix cluster error handling
uki00a Jul 7, 2021
6ea1807
chore: Debug
uki00a Jul 7, 2021
9523561
chore: Debug
uki00a Jul 7, 2021
4722814
chore: Log redirection message
uki00a Jul 7, 2021
889d276
fix: Fix key selecting
uki00a Jul 7, 2021
9dc5ea6
feat: Add ClusterExecutor#close
uki00a Jul 7, 2021
fdaa503
test(del): multiple keys in different hash slots
uki00a Jul 7, 2021
6c9cacf
fix: Close redis connections
uki00a Jul 8, 2021
a839756
chore: Tweak a test
uki00a Jul 8, 2021
58356c7
chore: Use lodash-es
uki00a Jul 8, 2021
61bf0b8
chore: Manage deps using deps.ts
uki00a Jul 8, 2021
fdba9b7
chore: Rename key_test.ts to test.ts
uki00a Jul 10, 2021
0654dd8
docs: Add README files
uki00a Jul 10, 2021
a5a49b5
chore: Manage deps with dlink
uki00a Jul 10, 2021
59adefa
chore: Run "deno fmt"
uki00a Jul 10, 2021
cf3abcf
fix: Remove redisOptions and add newRedis instead
uki00a Jul 10, 2021
03568fc
test: Verifies a -MOVED error is correctly handled
uki00a Jul 10, 2021
d1c7d8e
chore: Remove debugging things
uki00a Jul 10, 2021
0189a0c
test: Improve a test for a -MOVED error
uki00a Jul 10, 2021
91fdbba
fix: Update a test for a -MOVED error
uki00a Jul 10, 2021
45bdfdc
fix: Mistakenly imported shuffle.js instead of sample.js...
uki00a Jul 10, 2021
c746bc4
docs: Update experimental/cluster/README.md
uki00a Jul 10, 2021
76c9ce1
chore: Remove duplicated code
uki00a Jul 10, 2021
3f4fa7e
fix: Make maxConnections optional
uki00a Jul 10, 2021
d7928b5
chore: Add #getRedisLink method
uki00a Jul 10, 2021
e7aed82
test: Verify that a -ASK redirection error is correctly handled
uki00a Jul 10, 2021
fdfbb90
fix: Try to correctly handle -ASK errors
uki00a Jul 10, 2021
e3f0726
chore: Lint
uki00a Jul 10, 2021
e7dbe95
docs: Improve docs
uki00a Jul 10, 2021
84e6196
chore: Move pasing logig to ClusterNode
uki00a Jul 10, 2021
3a0d5ad
chore: Make config files in tests/tmp directory
uki00a Jul 10, 2021
526722a
Revert "test: Temporary disable all tests except those for redis clus…
uki00a Jul 10, 2021
005b63e
chore: Run "deno fmt"
uki00a Jul 10, 2021
dc07df6
ci: Fix build.yml
uki00a Jul 10, 2021
3f7b9ec
fix: Add tests/tmp/.gitkeep
uki00a Jul 10, 2021
43b5406
fix: redis.conf was not correctly copied...
uki00a Jul 10, 2021
e111313
chore: Minor fixes
uki00a Jul 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- name: Run tests
run: |
deno test --allow-net --allow-read=tests --allow-write=tests/server --allow-run=redis-server redis_test.ts
deno test --allow-net --allow-read=tests --allow-write=tests/tmp --allow-run=redis-server,redis-cli redis_test.ts
- uses: bahmutov/npm-install@v1
with:
working-directory: benchmark
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ commands
testdata/*/
benchmark/node_modules
benchmark/benchmark.js
tests/tmp/*/
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,12 @@ const sub = await cacheClient.subscribe<string[]>("__redis__:invalidate");
})();
```

### Experimental features

deno-redis provides some experimental features.

See [experimental/README.md](experimental/README.md) for details.

## Roadmap for v1

- See https://github.com/denodrivers/redis/issues/78
4 changes: 4 additions & 0 deletions command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,10 @@ XRANGE somestream - +
clientUnpause(): Promise<SimpleString>;

// Cluster
/**
* @see https://redis.io/topics/cluster-spec
*/
asking(): Promise<SimpleString>;
clusterAddSlots(...slots: number[]): Promise<SimpleString>;
clusterCountFailureReports(node_id: string): Promise<Integer>;
clusterCountKeysInSlot(slot: number): Promise<Integer>;
Expand Down
8 changes: 8 additions & 0 deletions experimental/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Experimental features

deno-redis has some experimental features:

- [Redis Cluster client](cluster/README.md)

**These experimental features may be subject to breaking changes even after a
major release.**
30 changes: 30 additions & 0 deletions experimental/cluster/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# experimental/cluster

[![deno doc](https://doc.deno.land/badge.svg)](https://doc.deno.land/https/deno.land/x/redis/experimental/cluster/mod.ts)

This module provides a client impelementation for
[the Redis Cluster](https://redis.io/topics/cluster-tutorial).

The implementation is based on the
[antirez/redis-rb-cluster](https://github.com/antirez/redis-rb-cluster).

## Usage

```typescript
import { connect } from "https://deno.land/x/redis/experimental/cluster/mod.ts";

const cluster = await connect({
nodes: [
{
hostname: "127.0.0.1",
port: 7000,
},
{
hostname: "127.0.0.1",
port: 7001,
},
],
});

await cluster.get("{foo}bar");
```
Loading