Skip to content

Commit c699781

Browse files
Revert "build: update redis and remove redis-py-cluster (#64711)"
This reverts commit 58c2f2c. Co-authored-by: anonrig <[email protected]>
1 parent 9fc06d2 commit c699781

File tree

18 files changed

+52
-52
lines changed

18 files changed

+52
-52
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .client import RedisCluster
2+
3+
__all__ = ('RedisCluster',)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from typing import TypeVar
2+
3+
from redis import Redis
4+
5+
T = TypeVar("T", str, bytes)
6+
7+
class RedisCluster(Redis[T]):
8+
...
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from redis.exceptions import RedisError
2+
3+
class ClusterError(RedisError): ...

requirements-base.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ fido2>=0.9.2
5252
python3-saml>=1.15.0
5353
PyYAML>=6.0.1
5454
rb>=1.9.0
55-
redis>=4.1.0
55+
redis-py-cluster>=2.1.0
56+
redis>=3.4.1
5657
requests-oauthlib>=1.2.0
5758
requests>=2.25.1
5859
# [start] jsonschema format validators
@@ -62,7 +63,7 @@ rfc3986-validator>=0.1.1
6263
sentry-arroyo>=2.16.0
6364
sentry-kafka-schemas>=0.1.50
6465
sentry-ophio==0.1.5
65-
sentry-redis-tools>=0.2.0
66+
sentry-redis-tools>=0.1.7
6667
sentry-relay>=0.8.45
6768
sentry-sdk>=1.39.2
6869
snuba-sdk>=2.0.25

requirements-dev-frozen.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ amqp==5.2.0
1010
anyio==3.7.1
1111
asgiref==3.7.2
1212
async-generator==1.10
13-
async-timeout==4.0.3
1413
attrs==23.1.0
1514
avalara==20.9.0
1615
beautifulsoup4==4.7.1
@@ -159,7 +158,8 @@ pyuwsgi==2.0.23
159158
pyvat==1.3.15
160159
pyyaml==6.0.1
161160
rb==1.10.0
162-
redis==4.5.4
161+
redis==3.4.1
162+
redis-py-cluster==2.1.0
163163
referencing==0.30.2
164164
regex==2022.9.13
165165
reportlab==4.0.7
@@ -179,7 +179,7 @@ sentry-forked-django-stubs==4.2.7.post3
179179
sentry-forked-djangorestframework-stubs==3.14.5.post1
180180
sentry-kafka-schemas==0.1.50
181181
sentry-ophio==0.1.5
182-
sentry-redis-tools==0.2.0
182+
sentry-redis-tools==0.1.7
183183
sentry-relay==0.8.45
184184
sentry-sdk==1.39.2
185185
sentry-usage-accountant==0.0.10
@@ -211,11 +211,10 @@ types-pillow==9.5.0.4
211211
types-protobuf==4.23.0.1
212212
types-psutil==5.9.5.16
213213
types-psycopg2==2.9.21
214-
types-pyopenssl==23.2.0.2
215214
types-python-dateutil==2.8.19
216215
types-pytz==2022.1.2
217216
types-pyyaml==6.0.11
218-
types-redis==4.6.0.3
217+
types-redis==3.5.18
219218
types-requests==2.31.0.20231231
220219
types-setuptools==65.3.0
221220
types-simplejson==3.17.7.2

requirements-dev.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ types-python-dateutil
5353
types-pytz
5454
types-pyyaml
5555
# make sure to match close-enough to redis==
56-
types-redis>=4.1
56+
types-redis<4
5757
types-requests>=2.31.0.20231231
5858
types-setuptools
5959
types-simplejson>=3.17.7.2

requirements-frozen.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
amqp==5.2.0
1010
anyio==3.7.1
1111
asgiref==3.7.2
12-
async-timeout==4.0.3
1312
attrs==23.1.0
1413
avalara==20.9.0
1514
beautifulsoup4==4.7.1
@@ -106,7 +105,8 @@ pyuwsgi==2.0.23
106105
pyvat==1.3.15
107106
pyyaml==6.0.1
108107
rb==1.10.0
109-
redis==4.5.4
108+
redis==3.4.1
109+
redis-py-cluster==2.1.0
110110
referencing==0.30.2
111111
regex==2022.9.13
112112
reportlab==4.0.7
@@ -120,7 +120,7 @@ s3transfer==0.10.0
120120
sentry-arroyo==2.16.0
121121
sentry-kafka-schemas==0.1.50
122122
sentry-ophio==0.1.5
123-
sentry-redis-tools==0.2.0
123+
sentry-redis-tools==0.1.7
124124
sentry-relay==0.8.45
125125
sentry-sdk==1.39.2
126126
sentry-usage-accountant==0.0.10

src/sentry/ingest/transaction_clusterer/rules.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,10 @@ def write(self, project: Project, rules: RuleSet) -> None:
6060
key = self._get_rules_key(project)
6161

6262
with client.pipeline() as p:
63+
# to be consistent with other stores, clear previous hash entries:
64+
p.delete(key)
6365
if len(rules) > 0:
64-
p.hset(key, mapping=rules)
65-
else:
66-
# to be consistent with other stores, clear previous hash entries:
67-
p.delete(key)
66+
p.hmset(key, rules)
6867
p.execute()
6968

7069
def update_rule(self, project: Project, rule: str, last_used: int) -> None:

src/sentry/processing/backpressure/memory.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import rb
66
import requests
7-
from redis.cluster import RedisCluster
7+
from rediscluster import RedisCluster
88

99

1010
@dataclass

src/sentry/ratelimits/concurrent.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
from sentry.exceptions import InvalidConfiguration
1010
from sentry.utils import redis
11-
from sentry.utils.redis import disconnect_redis_connection_pools
1211

1312
logger = logging.getLogger(__name__)
1413

@@ -35,7 +34,7 @@ def __init__(self, max_tll_seconds: int = DEFAULT_MAX_TTL_SECONDS) -> None:
3534
def validate(self) -> None:
3635
try:
3736
self.client.ping()
38-
disconnect_redis_connection_pools(self.client)
37+
self.client.connection_pool.disconnect()
3938
except Exception as e:
4039
raise InvalidConfiguration(str(e))
4140

0 commit comments

Comments
 (0)