Skip to content

AI.CONFIG MODEL_CHUNK_SIZE fails on Redis clusters #908

@billschereriii

Description

@billschereriii

Describe the bug
AI.CONFIG MODEL_CHUNK_SIZE fails when called in clustered Redis environments.

To Reproduce
Steps to reproduce the behavior:

  1. Set up a local Redis cluster of three nodes
  2. Compile and execute the code below (requires hiredis)
  3. Vary the shard connected to by changing the port parameter in the call to redisConnect() in line 6.
  4. Observe that for one port, the result is ok but for others it is in the form MOVED 2457 127.0.0.1:6379
#include <stdio.h>
#include "hiredis.h"

int main(int argc, char **argv)
{
    redisContext *ctx = redisConnect("127.0.0.1", 6380);
    if (ctx == NULL || ctx->err) {
        printf("Connection failed\n");
        return -1;
    }

    redisReply *reply = redisCommand(ctx, "AI.CONFIG MODEL_CHUNK_SIZE %d", 1024 * 1024);
    if (reply == NULL) {
        printf("Command failed (%d): %s\n", ctx->err, ctx->errstr);
        return -1;
    }
    else {
        printf("Command succeeded!\n");
        printf("reply: %s\n", reply->str);
    }
    freeReplyObject(reply);
    redisFree(ctx);

    return 1;
}

Expected behavior
We would expect the command to work correctly, independently of which shard it is sent to.

Screenshots
n/a

Environment (please complete the following information):

  • OS: ubuntu 20.04, MacOS
  • Version 1.2.3
  • Platform x86
  • Runtime CPU -- assume it doesn't matter

Additional context

  • We note that AI.CONFIG MODEL_CHUNK_SIZE is not covered in the RedisAI unit tests; nor is it supported in any of the sample clients in the RedisAI Github.
  • We originally ran into this issue when attempting to use the AI.CONFIG info command in SmartRedis, which goes through Redis-plus-plus; the distillation to hiredis above was part of our debugging efforts. The only response from Redis-plus-plus was "2457", which was particularly mystifying.
  • We note that the standard Redis CONFIG SET command works perfectly in our code and in the test driver; we speculate that maybe there is a registration issue of some sort with AI.CONFIG?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions