Skip to content

Commit

Permalink
Upstream the availability zone info string from KeyDB
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Jun 26, 2024
1 parent ab38730 commit 1c2868a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -3100,6 +3100,7 @@ standardConfig static_configs[] = {
/* SDS Configs */
createSDSConfig("primaryauth", "masterauth", MODIFIABLE_CONFIG | SENSITIVE_CONFIG, EMPTY_STRING_IS_NULL, server.primary_auth, NULL, NULL, NULL),
createSDSConfig("requirepass", NULL, MODIFIABLE_CONFIG | SENSITIVE_CONFIG, EMPTY_STRING_IS_NULL, server.requirepass, NULL, NULL, updateRequirePass),
createSDSConfig("availability-zone", NULL, MODIFIABLE_CONFIG, 0, server.sdsAvailabilityZone, "", NULL, NULL),

/* Enum Configs */
createEnumConfig("supervised", NULL, IMMUTABLE_CONFIG, supervised_mode_enum, server.supervised_mode, SUPERVISED_NONE, NULL, NULL),
Expand Down
3 changes: 2 additions & 1 deletion src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -5381,7 +5381,8 @@ sds genValkeyInfoString(dict *section_dict, int all_sections, int everything) {
"lru_clock:%u\r\n", server.lruclock,
"executable:%s\r\n", server.executable ? server.executable : "",
"config_file:%s\r\n", server.configfile ? server.configfile : "",
"io_threads_active:%i\r\n", server.io_threads_active));
"io_threads_active:%i\r\n", server.io_threads_active,
"availability_zone:%s\r\n", server.sdsAvailabilityZone));
/* clang-format on */

/* Conditional properties */
Expand Down
1 change: 1 addition & 0 deletions src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,7 @@ struct valkeyServer {
is down, doesn't affect pubsub global. */
long reply_buffer_peak_reset_time; /* The amount of time (in milliseconds) to wait between reply buffer peak resets */
int reply_buffer_resizing_enabled; /* Is reply buffer resizing enabled (1 by default) */
sds sdsAvailabilityZone; /* When run in a cloud environment we can configure the availability zone it is running in */
/* Local environment */
char *locale_collate;
};
Expand Down
6 changes: 6 additions & 0 deletions valkey.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2319,3 +2319,9 @@ jemalloc-bg-thread yes
# to suppress
#
# ignore-warnings ARM64-COW-BUG

# Inform Valkey of the availability zone if running in a cloud environment. Currently
# this is only exposed via the info command for clients to use, but in the future we
# we may also use this when making decisions for replication.
#
# availability-zone "us-east-1a"

0 comments on commit 1c2868a

Please sign in to comment.