Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid using transactions on OSS Redis #2296

Merged
merged 1 commit into from
Feb 8, 2022

Conversation

DvirDukhan
Copy link
Collaborator

Signed-off-by: DvirDukhan [email protected]

What this PR does / why we need it:
This PR avoids using Transactions in redis-py pipelines when on a single instance mode.
redis-py pipelines are created by default as transactions https://github.com/redis/redis-py/blob/24cdd70761c7c275d5010f628f83d919bf35fc90/redis/client.py#L1020
However, on cluster mode, redis-py pipeline is built with transaction=None https://github.com/redis/redis-py/blob/045d5ed15305ccc44a0330e6f65f669998815598/redis/cluster.py#L698
from https://redis.io/topics/transactions :

All the commands in a transaction are serialized and executed sequentially.
It can never happen that a request issued by another client is served in the middle of the execution of a Redis transaction.
This guarantees that the commands are executed as a single isolated operation.

This could change can help increasing throughput when accessing a single Redis instance with multiple Feast clients.

Does this PR introduce a user-facing change?:

NONE

CC @chayim

@DvirDukhan DvirDukhan requested a review from a team as a code owner February 8, 2022 08:35
@DvirDukhan DvirDukhan requested review from achals and removed request for a team February 8, 2022 08:35
@codecov-commenter
Copy link

codecov-commenter commented Feb 8, 2022

Codecov Report

Merging #2296 (3720d6e) into master (b86a99b) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2296      +/-   ##
==========================================
+ Coverage   86.01%   86.06%   +0.05%     
==========================================
  Files         116      116              
  Lines        9820     9820              
==========================================
+ Hits         8447     8452       +5     
+ Misses       1373     1368       -5     
Flag Coverage Δ
integrationtests 74.78% <100.00%> (-0.26%) ⬇️
unittests 58.55% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
sdk/python/feast/infra/online_stores/redis.py 94.83% <100.00%> (ø)
.../integration/online_store/test_universal_online.py 97.17% <0.00%> (+0.40%) ⬆️
sdk/python/feast/infra/online_stores/datastore.py 90.56% <0.00%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b86a99b...3720d6e. Read the comment docs.

Copy link
Collaborator

@adchia adchia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@feast-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adchia, DvirDukhan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@feast-ci-bot feast-ci-bot merged commit 144f25c into feast-dev:master Feb 8, 2022
adchia pushed a commit that referenced this pull request Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants