Skip to content

Commit

Permalink
avoid using transactions on redis-py (#2296)
Browse files Browse the repository at this point in the history
Signed-off-by: DvirDukhan <dvir@redis.com>
  • Loading branch information
DvirDukhan authored and adchia committed Feb 15, 2022
1 parent b862ea5 commit cc5336d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sdk/python/feast/infra/online_stores/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class RedisOnlineStore(OnlineStore):
def delete_entity_values(self, config: RepoConfig, join_keys: List[str]):
client = self._get_client(config.online_store)
deleted_count = 0
pipeline = client.pipeline()
pipeline = client.pipeline(transaction=False)
prefix = _redis_key_prefix(join_keys)

for _k in client.scan_iter(
Expand Down Expand Up @@ -188,7 +188,7 @@ def online_write_batch(
ts_key = f"_ts:{feature_view}"
keys = []
# redis pipelining optimization: send multiple commands to redis server without waiting for every reply
with client.pipeline() as pipe:
with client.pipeline(transaction=False) as pipe:
# check if a previous record under the key bin exists
# TODO: investigate if check and set is a better approach rather than pulling all entity ts and then setting
# it may be significantly slower but avoids potential (rare) race conditions
Expand Down Expand Up @@ -262,7 +262,7 @@ def online_read(
for entity_key in entity_keys:
redis_key_bin = _redis_key(project, entity_key)
keys.append(redis_key_bin)
with client.pipeline() as pipe:
with client.pipeline(transaction=False) as pipe:
for redis_key_bin in keys:
pipe.hmget(redis_key_bin, hset_keys)
with tracing_span(name="remote_call"):
Expand Down

0 comments on commit cc5336d

Please sign in to comment.