Fixed - Redis scan cursor exceed Long.MAX_VALUE in AWS Elasticache #5517

pull/5564/head
Nikita Koksharov 1 year ago
parent 91bd4bba2a
commit 6fa9ce61f7

@ -713,9 +713,11 @@ public class RedissonLiveObjectService implements RLiveObjectService {
RedisCommand<ListScanResult<String>> command = new RedisCommand<>("SCAN",
new ListMultiDecoder2(new ListScanResultReplayDecoder(), new ObjectListReplayDecoder<Object>()), new Convertor<Object>() {
int index;
@Override
public Object convert(Object obj) {
if (!(obj instanceof String)) {
index++;
if (index == 1) {
return obj;
}
return namingScheme.resolveId(obj.toString());

@ -161,7 +161,7 @@ public class RedissonSet<V> extends RedissonExpirable implements RSet<V>, ScanIt
+ "cursor = 0;"
+ "end;"
+ "if cursor == -1 then "
+ "return {0, {}}; "
+ "return {'0', {}}; "
+ "end;"
+ "local result; "
+ "if (#ARGV == 2) then "

@ -427,7 +427,7 @@ public class RedissonSortedSet<V> extends RedissonExpirable implements RSortedSe
+ "start_index = 0;"
+ "end;"
+ "if start_index == -1 then "
+ "return {0, {}}; "
+ "return {'0', {}}; "
+ "end;"
+ "local end_index = start_index + ARGV[1];"
+ "local result; "
@ -436,7 +436,7 @@ public class RedissonSortedSet<V> extends RedissonExpirable implements RSortedSe
+ "end_index = -1;"
+ "end; "
+ "redis.call('setex', KEYS[2], 3600, end_index);"
+ "return {end_index, result};",
+ "return {tostring(end_index), result};",
Arrays.asList(list.getRawName(), iteratorName), count);
}

Loading…
Cancel
Save