Skip to content

Commit 5de24f1

Browse files
DebianNormB
authored andcommitted
cachedb_redis: add Unix socket transport and lazy connection
Add Unix domain socket support as an alternative to TCP connections: - New URL format: redis:group://localhost/?socket=/path/to/sock - REDIS_UNIX_SOCKET flag for connection and node identification - MI output includes transport type (tcp/unix) and socket_path - Unix socket path tracked in redis_con and cluster_node structs Add lazy connection establishment: - New lazy_connect module parameter (integer, default 0) - Defers Redis connection until first cache operation - Works for both TCP and Unix socket transport modes Test suite: - test_unix_socket.sh: 19 integration tests - test_lazy_connect.sh: 17 integration tests - Test stubs synced with production struct layout Depends on: MR B (feature/redis-cluster-management)
1 parent 67e4d3e commit 5de24f1

11 files changed

Lines changed: 968 additions & 103 deletions

modules/cachedb_redis/cachedb_redis.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ static int mod_init(void);
4646
static int child_init(int);
4747
static void destroy(void);
4848

49+
int lazy_connect = 0;
50+
4951
str cache_mod_name = str_init("redis");
5052
struct cachedb_url *redis_script_urls = NULL;
5153

@@ -58,6 +60,7 @@ static const param_export_t params[]={
5860
{ "connect_timeout", INT_PARAM, &redis_connnection_tout},
5961
{ "query_timeout", INT_PARAM, &redis_query_tout },
6062
{ "shutdown_on_error", INT_PARAM, &shutdown_on_error },
63+
{ "lazy_connect", INT_PARAM, &lazy_connect },
6164
{ "cachedb_url", STR_PARAM|USE_FUNC_PARAM, (void *)&set_connection},
6265
{ "use_tls", INT_PARAM, &use_tls},
6366
{ "ftsearch_index_name", STR_PARAM, &fts_index_name.s},

0 commit comments

Comments
 (0)