From 8b7cfa0a3373ed00eb7ccf718139bedef2eeec07 Mon Sep 17 00:00:00 2001 From: teej4y Date: Wed, 15 May 2024 01:14:02 +0100 Subject: [PATCH] drop atomic_var field from server info --- src/bio.c | 3 ++- src/server.c | 7 ++++--- src/zmalloc.c | 1 - 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bio.c b/src/bio.c index 46f6b893f6..50fc46dcfe 100644 --- a/src/bio.c +++ b/src/bio.c @@ -62,6 +62,7 @@ #include "server.h" #include "bio.h" +#include static char* bio_worker_title[] = { "bio_close_file", @@ -265,8 +266,8 @@ void *bioProcessBackgroundJobs(void *arg) { { int last_status = atomic_load_explicit(&server.aof_bio_fsync_status, memory_order_relaxed); - atomic_store_explicit(&server.aof_bio_fsync_status, C_ERR, memory_order_relaxed); atomic_store_explicit(&server.aof_bio_fsync_errno, errno, memory_order_relaxed); + atomic_store_explicit(&server.aof_bio_fsync_status, C_ERR, memory_order_release); if (last_status == C_OK) { serverLog(LL_WARNING, "Fail to fsync the AOF file: %s",strerror(errno)); diff --git a/src/server.c b/src/server.c index e933b19fc3..7005c8ddbd 100644 --- a/src/server.c +++ b/src/server.c @@ -4588,9 +4588,11 @@ int writeCommandsDeniedByDiskError(void) { return DISK_ERROR_TYPE_AOF; } /* AOF fsync error. */ - int aof_bio_fsync_status = atomic_load_explicit(&server.aof_bio_fsync_status,memory_order_relaxed); + int aof_bio_fsync_status = atomic_load_explicit(&server.aof_bio_fsync_status, memory_order_relaxed); + atomic_thread_fence(memory_order_acquire); + if (aof_bio_fsync_status == C_ERR) { - server.aof_last_write_errno = atomic_load_explicit(&server.aof_bio_fsync_errno,memory_order_relaxed); + server.aof_last_write_errno = atomic_load_explicit(&server.aof_bio_fsync_errno, memory_order_relaxed); return DISK_ERROR_TYPE_AOF; } } @@ -5628,7 +5630,6 @@ sds genValkeyInfoString(dict *section_dict, int all_sections, int everything) { "arch_bits:%i\r\n", server.arch_bits, "monotonic_clock:%s\r\n", monotonicInfoString(), "multiplexing_api:%s\r\n", aeGetApiName(), - "atomicvar_api:%s\r\n", REDIS_ATOMIC_API, "gcc_version:%s\r\n", GNUC_VERSION_STR, "process_id:%I\r\n", (int64_t) getpid(), "process_supervised:%s\r\n", supervised, diff --git a/src/zmalloc.c b/src/zmalloc.c index ffb3b6d16a..27d6bdcb67 100644 --- a/src/zmalloc.c +++ b/src/zmalloc.c @@ -51,7 +51,6 @@ void zlibc_free(void *ptr) { #include #include "zmalloc.h" -#include "atomicvar.h" #include #define UNUSED(x) ((void)(x))