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

Replace master-reboot-down-after-period with primary-reboot-down-after-period in sentinel.conf #647

Merged
merged 5 commits into from
Jul 15, 2024

Conversation

hwware
Copy link
Member

@hwware hwware commented Jun 13, 2024

Update sentinel.conf config parameter,

From:

SENTINEL master-reboot-down-after-period mymaster 0

To:

SENTINEL primary-reboot-down-after-period myprimary 0

But we still keep the backward compatibility, clients could use SENTINEL master-reboot-down-after-period mymaster 0 OR
SENTINEL primary-reboot-down-after-period myprimary 0

Copy link

codecov bot commented Jun 13, 2024

Codecov Report

Attention: Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.

Project coverage is 70.27%. Comparing base (dd4bd50) to head (8cb77fe).

Additional details and impacted files
@@             Coverage Diff              @@
##           unstable     #647      +/-   ##
============================================
+ Coverage     70.11%   70.27%   +0.16%     
============================================
  Files           112      112              
  Lines         60587    60590       +3     
============================================
+ Hits          42480    42581     +101     
+ Misses        18107    18009      -98     
Files Coverage Δ
src/sentinel.c 0.00% <0.00%> (ø)

... and 9 files with indirect coverage changes

@hwware hwware force-pushed the update-primary-sentinel-conf branch from 307cca3 to 0b3d8a7 Compare June 13, 2024 17:44
Copy link
Contributor

@zuiderkwast zuiderkwast left a comment

Choose a reason for hiding this comment

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

LGTM.

There's still no primary alias for GET-MASTER-ADDR-BY-NAME? (#36)

There's some duplicated code in the test case. We could use a vaiable for primary/master, like this, if you want:

foreach role {primary master} {
    # ...
    S $id SENTINEL SET mymaster $role-reboot-down-after-period 5000
    # ...
}

@zuiderkwast zuiderkwast added the de-crapify Correct crap decisions made in the past label Jul 8, 2024
sentinel.conf Outdated Show resolved Hide resolved
@hwware hwware force-pushed the update-primary-sentinel-conf branch 2 times, most recently from 63ba675 to 3b2197d Compare July 10, 2024 15:08
@zuiderkwast
Copy link
Contributor

zuiderkwast commented Jul 12, 2024

3b2197d doesn't look right. Before this commit, the test case repeated the whole check for "master" and "primary". With the for loop it only repeats 3 commands for "primary" and "master".

I think we need to put this foreach role {primary master} around more code, until the end of the test case, so we actually test everything for primary and everything again for master. Makes sense?

    foreach role {master primary} {
        foreach_sentinel_id id {
            S $id SENTINEL SET mymaster $role-reboot-down-after-period 5000
            ...
        }

        kill_instance valkey $master_id
        reboot_instance valkey $master_id
    
        foreach_sentinel_id id {
            ...
        }

        ...

        # Make sure the instance load all the dataset
        while 1 {
            ...
        }
    }
} ; # <--- end of test case

Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
Signed-off-by: hwware <wen.hui.ware@gmail.com>
@hwware hwware force-pushed the update-primary-sentinel-conf branch from 3b2197d to 8cb77fe Compare July 15, 2024 15:54
@hwware hwware merged commit 1a8bd04 into valkey-io:unstable Jul 15, 2024
20 checks passed
@javsalgar
Copy link

Hi! Trying this on version 8.0, I see that it crashes with the default sentinel.conf values

*** FATAL CONFIG FILE ERROR (Version 8.0.0) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.

To fix I need to replace myprimary with mymaster

@enjoy-binbin
Copy link
Member

@javsalgar thanks for the report. I will take a look later

enjoy-binbin added a commit to enjoy-binbin/valkey that referenced this pull request Sep 17, 2024
Since in here the monitor value is mymaster, we need to make sure the primary
name is the same, otherwise the default configuration cannot start sentinel.
```
sentinel monitor mymaster 127.0.0.1 6379 2
```

The following error occurs when the default configuration is started:
```
*** FATAL CONFIG FILE ERROR (Version 255.255.255) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.
```

Introduced in valkey-io#647.

Signed-off-by: Binbin <binloveplay1314@qq.com>
enjoy-binbin added a commit that referenced this pull request Sep 21, 2024
#1040)

Since in here the monitor value is mymaster, we need to make sure the
primary name is the same, otherwise the default configuration cannot start
sentinel.
```
sentinel monitor mymaster 127.0.0.1 6379 2
```

The following error occurs when the default configuration is started:
```
*** FATAL CONFIG FILE ERROR (Version 255.255.255) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.
```

Introduced in #647.

Signed-off-by: Binbin <binloveplay1314@qq.com>
madolson pushed a commit to madolson/valkey that referenced this pull request Sep 30, 2024
valkey-io#1040)

Since in here the monitor value is mymaster, we need to make sure the
primary name is the same, otherwise the default configuration cannot start
sentinel.
```
sentinel monitor mymaster 127.0.0.1 6379 2
```

The following error occurs when the default configuration is started:
```
*** FATAL CONFIG FILE ERROR (Version 255.255.255) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.
```

Introduced in valkey-io#647.

Signed-off-by: Binbin <binloveplay1314@qq.com>
PingXie pushed a commit to PingXie/valkey that referenced this pull request Oct 9, 2024
valkey-io#1040)

Since in here the monitor value is mymaster, we need to make sure the
primary name is the same, otherwise the default configuration cannot start
sentinel.
```
sentinel monitor mymaster 127.0.0.1 6379 2
```

The following error occurs when the default configuration is started:
```
*** FATAL CONFIG FILE ERROR (Version 255.255.255) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.
```

Introduced in valkey-io#647.

Signed-off-by: Binbin <binloveplay1314@qq.com>
naglera pushed a commit to naglera/placeholderkv that referenced this pull request Oct 10, 2024
valkey-io#1040)

Since in here the monitor value is mymaster, we need to make sure the
primary name is the same, otherwise the default configuration cannot start
sentinel.
```
sentinel monitor mymaster 127.0.0.1 6379 2
```

The following error occurs when the default configuration is started:
```
*** FATAL CONFIG FILE ERROR (Version 255.255.255) ***
Reading the configuration file, at line 358
>>> 'SENTINEL primary-reboot-down-after-period myprimary 0'
No such master with specified name.
```

Introduced in valkey-io#647.

Signed-off-by: Binbin <binloveplay1314@qq.com>
Signed-off-by: naglera <anagler123@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
de-crapify Correct crap decisions made in the past
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants