Skip to content

Commit

Permalink
bugfix(UTAPI-109): Append uuidv4 to sorted set members during reindex
Browse files Browse the repository at this point in the history
  • Loading branch information
tmacro committed Oct 9, 2024
1 parent 6c96d08 commit 3d08d9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/reindex/s3_bucketd.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import time
import urllib
from collections import defaultdict, namedtuple
import uuid
from concurrent.futures import ThreadPoolExecutor

import redis
Expand Down Expand Up @@ -387,11 +388,13 @@ def update_redis(client, resource, name, obj_count, total_size):
timestamp = int(time.time() - 15 * 60) * 1000
obj_count_key = 's3:%s:%s:numberOfObjects' % (resource, name)
total_size_key = 's3:%s:%s:storageUtilized' % (resource, name)
obj_count_serialized = f"{obj_count}:{uuid.uuid4()}"
total_size_serialized = f"{total_size}:{uuid.uuid4()}"

client.zremrangebyscore(obj_count_key, timestamp, timestamp)
client.zremrangebyscore(total_size_key, timestamp, timestamp)
client.zadd(obj_count_key, {obj_count: timestamp})
client.zadd(total_size_key, {total_size: timestamp})
client.zadd(obj_count_key, {obj_count_serialized: timestamp})
client.zadd(total_size_key, {total_size_serialized: timestamp})
client.set(obj_count_key + ':counter', obj_count)
client.set(total_size_key + ':counter', total_size)

Expand Down

0 comments on commit 3d08d9d

Please sign in to comment.