Skip to content

Commit

Permalink
drop atomic_var field from server info
Browse files Browse the repository at this point in the history
  • Loading branch information
teej4y committed May 15, 2024
1 parent dd2b27e commit 8b7cfa0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@

#include "server.h"
#include "bio.h"
#include <stdatomic.h>

static char* bio_worker_title[] = {
"bio_close_file",
Expand Down Expand Up @@ -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));
Expand Down
7 changes: 4 additions & 3 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion src/zmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ void zlibc_free(void *ptr) {

#include <string.h>
#include "zmalloc.h"
#include "atomicvar.h"
#include <stdatomic.h>

#define UNUSED(x) ((void)(x))
Expand Down

0 comments on commit 8b7cfa0

Please sign in to comment.