i use mysql2redis(https://github.com/dawnbreaks/mysql2redis) in mysql procedure:

BEGIN DECLARE v_index INT DEFAULT 1; DECLARE v_ret INT;

WHILE v_index<=2000 DO
    SET v_ret=redis_command_v2('LPUSH', 'testKeyDB2', CONCAT(v_index));
    SET v_index=v_index+1;
END WHILE;

END

Comment From: laixintao

Can you list the elements in you list?

Comment From: daidaotong

Can you make sure testKeyDB2 is empty before this procedure?

Comment From: hezhiqiang

1.yes, i delete testKeyDB2 and then run procedure 2.the list value is 2000 to 1 and last is 1000

Comment From: laixintao

Did you mean there is an extra 1000? why?

Comment From: daidaotong

@hezhiqiang Hello, I reran the same logic by using redis-py and I did not see this issue, the length of list is exactly 2000, therefore I don't think it is bug from Redis core, can you please share your full test script for us to take look? thanks

Comment From: hezhiqiang

@daidaotong install mysql2redis(https://github.com/dawnbreaks/mysql2redis), then write a procedure in mysql:

BEGIN DECLARE v_index INT DEFAULT 1; DECLARE v_ret INT;

WHILE v_index<=2000 DO
    SET v_ret=redis_command_v2('LPUSH', 'testKeyDB2', CONCAT(v_index));
    SET v_index=v_index+1;
END WHILE;

END

Comment From: hezhiqiang

@laixintao yes, there is am extra 1000

Comment From: hezhiqiang

in java is the same problem, java code is:

public class XhsTestApplication { public static void main(String[] args) { JedisPoolConfig config = new JedisPoolConfig(); config.setMaxTotal(1000); config.setMaxIdle(50);

    JedisPool jedisPool = new JedisPool(config, "192.168.6.67", 6379, 30000, "xxx");

    Jedis jedis = jedisPool.getResource();
    try {
        int i = 1;
        while (i<=2000) {
            jedis.lpush("testKeyDB2", i+"");
            i++;
        }
    } finally {
        jedis.close();
        jedisPool.close();
    }
}

}

Comment From: laixintao

Hi I run you program and check in redis, it's exactly 2000

Comment From: laixintao

Comment From: hezhiqiang

my redis version is 5.0.5, and client and server is not same machine

Comment From: laixintao

I don't think redis will make such a mistake.

I think you can capture the tcp packets and see where is wrong.

Comment From: daidaotong

@hezhiqiang Hello, from your script I did not see any obvious bug which causing this issue, I also cannot reproduce this issue in my environment, I suggest you double check your testing environment, make sure you did not have other clients connect with the server at the same time, also as @laixintao suggested, capture the packets to see what's wrong.....Hope that helps. thanks

Comment From: hezhiqiang

thanks so very much, ^_^

can anyone recommend the tool to capture the tcp packets?

Comment From: hezhiqiang

i installed redis 5.0.7, also has this problem...

Comment From: hezhiqiang

o, i use redis-cli to llen, there is right, maybe this is RedisStudio bug, i try to change a manage client.

Comment From: hezhiqiang

can anyone recommend some redis manage client(windows)?^_^

Comment From: laixintao

can anyone recommend some redis manage client(windows)?^_^

I wrote https://github.com/laixintao/iredis , give it a try.

It has auto-completion and syntax highlighting, forget GUI.

Comment From: hezhiqiang

@laixintao thanks very much, ^_^