Skip to content

Sentinel #10

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

Open
wants to merge 80 commits into
base: v5
Choose a base branch
from
Open

Sentinel #10

wants to merge 80 commits into from

Conversation

sjpotter
Copy link
Collaborator

Description

Describe your pull request here


Checklist

  • Does npm test pass with this change (including linting)?
  • Is the new or changed code fully tested?
  • Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?

@sjpotter
Copy link
Collaborator Author

note, tsconfig.base.json as is, doesn't transpile import into request, which gives m problems when testing by hand.

return { "host": data[3], "port": Number(data[5]) };
}

export function createNodeList(data: any) {
Copy link

Choose a reason for hiding this comment

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

There's a lot of any for typing here...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes, I dont know how to get typing out of raw redis commands yet.


for (const nodeData of data) {
const node = parseNode(nodeData)
if (node === undefined) {
Copy link

Choose a reason for hiding this comment

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

undefined is like false in node - can we do an if/else here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

what do you mean? in this case, I have parseNode return undefined for a node that is down, so can ignore it.

);

export default class RedisSentinelMultiCommand<REPLIES = []> {
private static _createCommand(command: Command, resp: RespVersions) {
Copy link

@chayim chayim Nov 14, 2023

Choose a reason for hiding this comment

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

a lot of boilerplating - can this be done better

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

copied/pasted from cluster object

sjpotter and others added 30 commits December 22, 2023 13:20
1) it takes a lot of time now, so needs larger timeout
2) docker logs can be large, so need to increase maxBuffer size so doesn't error (and break test clean up)
+ provide API for other wrapper clients to also create invalid watch states programatically.

Reasoning: if a user does a WATCH and then the client reconnects, the watch is no longer active, but if a user does a MULTI/EXEC after that, they wont know, and since the WATCH is no longer active, the request has no protection.

The API is needed for when a wrapper client (say sentinel, cluster) might close the underlying client and reopen a new one transparently to the user.  Just like in the reconnection case, this should result in an error, but its up to the wrapping client to provide the appropriate error
though I realize this implementation, really only works after the first write command.

unsure this is worth it.
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

Successfully merging this pull request may close these issues.

3 participants