diff options
author | Binbin <binloveplay1314@qq.com> | 2023-03-21 23:51:47 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-21 17:51:47 +0200 |
commit | 78f15b7ef1a00e5c83d7128cefaf02f9262b9452 (patch) | |
tree | 272a2bb2fea6f15637a8a11e17afea5c4cbae4e4 /src/server.h | |
parent | 1cb4b1ad07a0c9a0d256a4b947158ae6658458d2 (diff) | |
download | redis-78f15b7ef1a00e5c83d7128cefaf02f9262b9452.tar.gz |
Fix race in temp rdb delete shutdown test (#11840)
I saw this error once, in the FreeBSD Daily CI:
```
*** [err]: Temp rdb will be deleted if we use bg_unlink when shutdown in tests/unit/shutdown.tcl
Expected [file exists /xxx/temp-10336.rdb] (context: type eval line 15 cmd {assert {[file exists $temp_rdb]}} proc ::test)
```
The log shows that bgsave was executed, and it was successfully executed in the end:
```
Starting test Temp rdb will be deleted if we use bg_unlink when shutdown in tests/unit/shutdown.tcl
10251:M 22 Feb 2023 11:37:25.441 * Background saving started by pid 10336
10336:C 22 Feb 2023 11:37:27.949 * DB saved on disk
10336:C 22 Feb 2023 11:37:27.949 * Fork CoW for RDB: current 0 MB, peak 0 MB, average 0 MB
10251:M 22 Feb 2023 11:37:28.060 * Background saving terminated with success
```
There may be two reasons:
1. The child process has been created, but it has not created
the temp rdb file yet, so [file exists $temp_rdb] check failed.
2. The child process bgsave has been executed successfully and the
temp file has been deleted, so [file exists $temp_rdb] check failed.
From the logs pint, it should be the case 2, case 1 is too extreme,
set rdb-key-save-delay to a higher value to ensure bgsave does not
succeed early to avoid this case.
Diffstat (limited to 'src/server.h')
0 files changed, 0 insertions, 0 deletions