redis-cli LRU test mode: randomize value of key when setting.

This way it is possible from an observer to tell when the key is
replaced with a new one having the same name.
This commit is contained in:
antirez 2016-07-18 10:56:11 +02:00
parent b8450d7cc5
commit 24dd4a8f04

View File

@ -2424,8 +2424,11 @@ static void LRUTestMode(void) {
while(mstime() - start_cycle < 1000) {
/* Write cycle. */
for (j = 0; j < LRU_CYCLE_PIPELINE_SIZE; j++) {
char val[6];
val[5] = '\0';
for (int i = 0; i < 5; i++) val[i] = 'A'+rand()%('z'-'A');
LRUTestGenKey(key,sizeof(key));
redisAppendCommand(context, "SET %s val",key);
redisAppendCommand(context, "SET %s %s",key,val);
}
for (j = 0; j < LRU_CYCLE_PIPELINE_SIZE; j++)
redisGetReply(context, (void**)&reply);