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

Redis enable cluster mode #791

Open
Edtcetera opened this issue Nov 1, 2022 · 2 comments
Open

Redis enable cluster mode #791

Edtcetera opened this issue Nov 1, 2022 · 2 comments

Comments

@Edtcetera
Copy link

Edtcetera commented Nov 1, 2022

When I create a Redis node with the argument '--cluster-enabled yes' the ethercalc service begins to crash when a single user joins the spreadsheet with the following logs:

0|ethercalc  | join [log-fxtck74lslqx_formdata] [user-0.2646795842316232]

0|ethercalc  | TypeError: Cannot read property '0' of undefined

0|ethercalc  |     at /usr/local/lib/node_modules/ethercalc/main.js:826:28

0|ethercalc  |     at Command.callback (/usr/local/lib/node_modules/ethercalc/node_modules/redis/index.js:1144:17)

0|ethercalc  |     at RedisClient.return_error (/usr/local/lib/node_modules/ethercalc/node_modules/redis/index.js:571:25)

0|ethercalc  |     at ReplyParser.<anonymous> (/usr/local/lib/node_modules/ethercalc/node_modules/redis/index.js:317:18)

0|ethercalc  |     at ReplyParser.emit (node:events:376:20)

0|ethercalc  |     at ReplyParser.send_error (/usr/local/lib/node_modules/ethercalc/node_modules/redis/lib/parser/javascript.js:296:10)

0|ethercalc  |     at ReplyParser.execute (/usr/local/lib/node_modules/ethercalc/node_modules/redis/lib/parser/javascript.js:181:22)

0|ethercalc  |     at RedisClient.on_data (/usr/local/lib/node_modules/ethercalc/node_modules/redis/index.js:547:27)

0|ethercalc  |     at Socket.<anonymous> (/usr/local/lib/node_modules/ethercalc/node_modules/redis/index.js:102:14)

0|ethercalc  |     at Socket.emit (node:events:376:20)

0|ethercalc  |     at addChunk (node:internal/streams/readable:311:12)

0|ethercalc  |     at readableAddChunk (node:internal/streams/readable:286:9)

0|ethercalc  |     at Socket.Readable.push (node:internal/streams/readable:225:10)

0|ethercalc  |     at TCP.onStreamRead (node:internal/stream_base_commons:192:23)
PM2          | App [ethercalc:0] exited with code [1] via signal [SIGINT]

When cluster-enabled is default false, ethercalc multi-user support functions correctly

I am using Redis:7.0.5

@Edtcetera
Copy link
Author

I will take a crack at this, from the looks of this I will need to upgrade node redis and follow their clustering guide as connecting to a redis cluster seems to be different: https://github.com/redis/node-redis/blob/master/docs/clustering.md

I assume the ethercalc connection to redis is done at db.ls : https://github.com/audreyt/ethercalc/blob/master/src/db.ls

@Edtcetera
Copy link
Author

I've forked the project and managed to migrate the redis client package to the latest ioredis package which supports Redis Sentinel and Clusters:
Edtcetera@cf45654

I will need to add more flags for Sentinel/Cluster setup, as well as support for Redis username

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant