Add a note to conf about the dangers of modifying dir at runtime (#887)

We've had security issues in the past with it, which is why
we marked it as PROTECTED. But, modifying during runtime
is also a dangerous action. For example, when child processes
are running, persistent temp files and log files may have
unexpected effects.

A scenario for modifying dir at runtime is to migrate a disk
failure, such as using disk-based replication to migrate a node,
writing nodes.conf to save the cluster configuration.

We decided to leave it as is and add a note in the conf
about the dangers of modifying dir at runtime.

Signed-off-by: Binbin <binloveplay1314@qq.com>
This commit is contained in:
Binbin 2024-12-08 20:28:14 +08:00 committed by GitHub
parent f20d629dbe
commit 176fafcaf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View File

@ -980,6 +980,13 @@ start_server {tags {"introspection"}} {
}
} {} {external:skip}
test {valkey-server command line arguments - dir multiple times} {
start_server {config "default.conf" args {--dir "./" --dir "./"}} {
r config get dir
assert_equal {PONG} [r ping]
}
} {} {external:skip}
# Config file at this point is at a weird state, and includes all
# known keywords. Might be a good idea to avoid adding tests here.
}

View File

@ -582,6 +582,9 @@ rdb-del-sync-files no
# The working directory.
#
# The server log is written relative this directory, if the 'logfile'
# configuration directive is a relative path.
#
# The DB will be written inside this directory, with the filename specified
# above using the 'dbfilename' configuration directive.
#
@ -591,6 +594,9 @@ rdb-del-sync-files no
# 'cluster-config-file' configuration directive is a relative path.
#
# Note that you must specify a directory here, not a file name.
# Note that modifying 'dir' during runtime may have unexpected behavior,
# for example when a child process is running, related file operations may
# have unexpected effects.
dir ./
################################# REPLICATION #################################