30 RCSIDH(cluster_h,
"$Id: f0a0aaf99fa4c22e26d1d8c7a71b3257c6e0a39a $")
32 #include <freeradius-devel/server/pool.h>
90 uint8_t const *key,
size_t key_len);
111 uint8_t const *key,
size_t key_len,
bool read_only);
134 bool enable_triggers,
135 char const *log_prefix,
136 char const *trigger_prefix,
A section grouping multiple CONF_PAIR.
Indexes in the fr_redis_cluster_node_t array for a single key slot.
fr_redis_rcode_t fr_redis_cluster_state_next(fr_redis_cluster_state_t *state, fr_redis_conn_t **conn, fr_redis_cluster_t *cluster, request_t *request, fr_redis_rcode_t status, redisReply **reply)
Get the next connection to attempt a command against.
size_t key_len
Length of the key.
fr_redis_cluster_key_slot_t const * fr_redis_cluster_slot_by_key(fr_redis_cluster_t *cluster, request_t *request, uint8_t const *key, size_t key_len)
Implements the key slot selection scheme used by freeradius.
bool close_conn
Set by caller of fr_redis_cluster_state_next, to indicate that connection must be closed,...
ssize_t fr_redis_cluster_node_addr_by_role(TALLOC_CTX *ctx, fr_socket_t *out[], fr_redis_cluster_t *cluster, bool is_master, bool is_slave)
Return an array of IP addresses belonging to masters or slaves.
size_t fr_redis_cluster_rcodes_table_len
int fr_redis_cluster_port(uint16_t *out, fr_redis_cluster_node_t const *node)
Return the port of a particular node.
int fr_redis_cluster_pool_by_node_addr(fr_pool_t **pool, fr_redis_cluster_t *cluster, fr_socket_t *node, bool create)
Get the pool associated with a node in the cluster.
void * fr_redis_cluster_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout)
Create a new connection to a Redis node.
uint32_t retries
How many times we've received TRYAGAIN.
fr_redis_cluster_rcode_t fr_redis_cluster_remap(request_t *request, fr_redis_cluster_t *cluster, fr_redis_conn_t *conn)
Perform a runtime remap of the cluster.
uint32_t reconnects
How many connections we've tried in this pool.
uint8_t const * key
Key we performed hashing on.
fr_redis_cluster_node_t const * fr_redis_cluster_slave(fr_redis_cluster_t *cluster, fr_redis_cluster_key_slot_t const *key_slot, uint8_t slave_num)
Return the slave node that would be used for a particular key.
fr_redis_cluster_rcode_t
Return values for internal functions.
@ FR_REDIS_CLUSTER_RCODE_IGNORED
Operation ignored.
@ FR_REDIS_CLUSTER_RCODE_FAILED
Operation failed.
@ FR_REDIS_CLUSTER_RCODE_SUCCESS
Operation completed successfully.
@ FR_REDIS_CLUSTER_RCODE_BAD_INPUT
Validation error.
@ FR_REDIS_CLUSTER_RCODE_NO_CONNECTION
Operation failed because we couldn't find a live connection.
fr_redis_rcode_t fr_redis_cluster_state_init(fr_redis_cluster_state_t *state, fr_redis_conn_t **conn, fr_redis_cluster_t *cluster, request_t *request, uint8_t const *key, size_t key_len, bool read_only)
Resolve a key to a pool, and reserve a connection in that pool.
fr_redis_cluster_node_t const * fr_redis_cluster_master(fr_redis_cluster_t *cluster, fr_redis_cluster_key_slot_t const *key_slot)
Return the master node that would be used for a particular key.
uint32_t redirects
How many redirects have we followed.
fr_redis_cluster_t * fr_redis_cluster_alloc(TALLOC_CTX *ctx, CONF_SECTION *module, fr_redis_conf_t *conf, bool enable_triggers, char const *log_prefix, char const *trigger_prefix, fr_pair_list_t *trigger_args)
Allocate and initialise a new cluster structure.
fr_table_num_sorted_t const fr_redis_cluster_rcodes_table[]
fr_redis_cluster_node_t * node
Node we're communicating with.
int fr_redis_cluster_ipaddr(fr_ipaddr_t *out, fr_redis_cluster_node_t const *node)
Return the ipaddr of a particular node.
uint32_t in_pool
How many available connections are there in the pool.
bool fr_redis_cluster_min_version(fr_redis_cluster_t *cluster, char const *min_version)
Check if members of the cluster are above a certain version.
Redis connection sequence state.
static fr_time_delta_t timeout
fr_redis_rcode_t
Codes are ordered inversely by priority.
Configuration parameters for a redis connection.
Connection handle, holding a redis context.
An element in a lexicographically sorted array of name to num mappings.
A time delta, a difference in time measured in nanoseconds.
Holds information necessary for binding or connecting to a socket.
static size_t char ** out