Skip to content

[CAE-342] Initial sentinel issues fix #2912

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 7 commits into
base: master
Choose a base branch
from
Open

[CAE-342] Initial sentinel issues fix #2912

wants to merge 7 commits into from

Conversation

htemelski
Copy link
Collaborator

@htemelski htemelski commented Mar 21, 2025

Description

Fixed a couple of issues with the sentinel implementation

  1. Indefinite reconnects without taking into consideration maxCommandRediscovers
  2. Client losing it's watch status if there are multiple topology changes during a transaction

Fixed an issue with the testing setup itself, using the new docker image and setting the requirepass and masterauth configuration settings in a persistent way.

Enabled the majority of sentinel tests, added new test for fix 1.
Still skipping some tests that are flaky and prone to failing


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)?

@@ -325,6 +325,10 @@ export default class RedisClient<
return this._self.#watchEpoch !== undefined;
}

get isDirtyWatch() {
Copy link
Member

Choose a reason for hiding this comment

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

Can you please add a tsdoc comment explaining the purpose behind isDirtyWatch / setDirtyWatch?

const sentinelArgs: Array<string> = ["sh", "-c"];

let sentinelConfig = `
port {port}
Copy link
Member

Choose a reason for hiding this comment

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

Hi @htemelski 👋 We should use our docker container for spawning sentinel instances if we want to be able to switch/skip tests easily between server versions.

@@ -51,21 +50,30 @@ export interface RedisServerDocker {
async function spawnRedisServerDocker({
image,
version
}: RedisServerDockerConfig, serverArguments: Array<string>): Promise<RedisServerDocker> {
}: RedisServerDockerConfig, serverArguments: Array<string>, dockerEnv?: Map<string, string>): Promise<RedisServerDocker> {
Copy link
Member

Choose a reason for hiding this comment

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

Instead of adding dockerEnv, dockerBinds, and so on, please add them as optional properties to the RedisServerDockerConfig like :

export interface VolumeMount {
source: string; // Host path
target: string; // Container path
readonly?: boolean; // Read-only mount
}

export interface RedisServerDockerConfig {
image: string;
version: string;
env?: Record<string, string>;
volumes?: VolumeMount[];
}

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