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

Rename redis in aof logs and proc title redis-aof-rewrite to valkey-aof-rewrite. #393

Merged
merged 7 commits into from May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 11 additions & 7 deletions src/aof.c
Expand Up @@ -996,7 +996,7 @@ int startAppendOnly(void) {

if (rewriteAppendOnlyFileBackground() == C_ERR) {
server.aof_state = AOF_OFF;
serverLog(LL_WARNING,"Redis needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
serverLog(LL_WARNING,"The server needs to enable the AOF but can't trigger a background AOF rewrite operation. Check the above logs for more info about the error.");
return C_ERR;
}
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@ void flushAppendOnlyFile(int force) {
/* Otherwise fall through, and go write since we can't wait
* over two seconds. */
server.aof_delayed_fsync++;
serverLog(LL_NOTICE,"Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down Redis.");
serverLog(LL_NOTICE,"Asynchronous AOF fsync is taking too long (disk is busy?). Writing the AOF buffer without waiting for fsync to complete, this may slow down the server.");
}
}
/* We want to perform a single write. This should be guaranteed atomic
Expand Down Expand Up @@ -1183,7 +1183,7 @@ void flushAppendOnlyFile(int force) {
if (ftruncate(server.aof_fd, server.aof_last_incr_size) == -1) {
if (can_log) {
serverLog(LL_WARNING, "Could not remove short write "
"from the append-only file. Redis may refuse "
"from the append-only file. The server may refuse "
"to load the AOF the next time it starts. "
"ftruncate: %s", strerror(errno));
}
Expand Down Expand Up @@ -1224,7 +1224,7 @@ void flushAppendOnlyFile(int force) {
* OK state and log the event. */
if (server.aof_last_write_status == C_ERR) {
serverLog(LL_NOTICE,
"AOF write error looks solved, Redis can write again.");
"AOF write error looks solved, The server can write again.");
Shivshankar-Reddy marked this conversation as resolved.
Show resolved Hide resolved
server.aof_last_write_status = C_OK;
}
}
Expand Down Expand Up @@ -1634,14 +1634,14 @@ int loadSingleAppendOnlyFile(char *filename) {
}
}
serverLog(LL_WARNING, "Unexpected end of file reading the append only file %s. You can: "
"1) Make a backup of your AOF file, then use ./redis-check-aof --fix <filename.manifest>. "
"1) Make a backup of your AOF file, then use ./valkey-check-aof --fix <filename.manifest>. "
"2) Alternatively you can set the 'aof-load-truncated' configuration option to yes and restart the server.", filename);
ret = AOF_FAILED;
goto cleanup;

fmterr: /* Format error. */
serverLog(LL_WARNING, "Bad file format reading the append only file %s: "
"make a backup of your AOF file, then use ./redis-check-aof --fix <filename.manifest>", filename);
"make a backup of your AOF file, then use ./valkey-check-aof --fix <filename.manifest>", filename);
ret = AOF_FAILED;
/* fall through to cleanup. */

Expand Down Expand Up @@ -2471,7 +2471,11 @@ int rewriteAppendOnlyFileBackground(void) {
char tmpfile[256];

/* Child */
serverSetProcTitle("redis-aof-rewrite");
if (server.server_symlink) {
zuiderkwast marked this conversation as resolved.
Show resolved Hide resolved
serverSetProcTitle("redis-aof-rewrite");
} else {
serverSetProcTitle("valkey-aof-rewrite");
}
serverSetCpuAffinity(server.aof_rewrite_cpulist);
snprintf(tmpfile,256,"temp-rewriteaof-bg-%d.aof", (int) getpid());
if (rewriteAppendOnlyFile(tmpfile) == C_OK) {
Expand Down
2 changes: 1 addition & 1 deletion src/cluster_legacy.c
Expand Up @@ -808,7 +808,7 @@ int clusterLockConfig(char *filename) {
* we need save `fd` to `cluster_config_file_lock_fd`, so that in serverFork(),
* it will be closed in the child process.
* If it is not closed, when the main process is killed -9, but the child process
* (redis-aof-rewrite) is still alive, the fd(lock) will still be held by the
* (valkey-aof-rewrite) is still alive, the fd(lock) will still be held by the
* child process, and the main process will fail to get lock, means fail to start. */
server.cluster_config_file_lock_fd = fd;
#else
Expand Down
9 changes: 9 additions & 0 deletions src/server.c
Expand Up @@ -6992,6 +6992,15 @@ int main(int argc, char **argv) {
char *exec_name = strrchr(argv[0], '/');
if (exec_name == NULL) exec_name = argv[0];
server.sentinel_mode = checkForSentinelMode(argc,argv, exec_name);

/* Determine Valkey is started by using symlinks, server.server_symlink can be used
* to set actual process name later. */
if (strstr(exec_name,"redis-server") != NULL) {
server.server_symlink = VALKEY_SYMLINKED;
} else {
server.server_symlink = VALKEY_NOT_SYMLINKED;
}

initServerConfig();
ACLInit(); /* The ACL subsystem must be initialized ASAP because the
basic networking code and client creation depends on it. */
Expand Down
4 changes: 4 additions & 0 deletions src/server.h
Expand Up @@ -96,6 +96,9 @@ struct hdr_histogram;
/* helpers */
#define numElements(x) (sizeof(x)/sizeof((x)[0]))

#define VALKEY_NOT_SYMLINKED 0 /* To determine Valkey started using symlink */
#define VALKEY_SYMLINKED 1 /* To determine Valkey started using symlink */

/* min/max */
#undef min
#undef max
Expand Down Expand Up @@ -2073,6 +2076,7 @@ struct valkeyServer {
int reply_buffer_resizing_enabled; /* Is reply buffer resizing enabled (1 by default) */
/* Local environment */
char *locale_collate;
int server_symlink;
};

#define MAX_KEYS_BUFFER 256
Expand Down