-
Notifications
You must be signed in to change notification settings - Fork 401
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
feat(idempotency): adding redis as idempotency backend #2567
feat(idempotency): adding redis as idempotency backend #2567
Conversation
… the idempotency key
Signed-off-by: Vandita Patidar <[email protected]>
Signed-off-by: Vandita Patidar <[email protected]>
No acknowledgement section found. Please make sure you used the template to open a PR and didn't remove the acknowledgment section. Check the template here: https://github.com/aws-powertools/powertools-lambda-python/blob/develop/.github/PULL_REQUEST_TEMPLATE.md#acknowledgment |
No related issues found. Please ensure there is an open issue related to this change to avoid significant delays or closure. |
Hello @rubenfonseca! We are ready for you to review this PR a second time. cc @roger-zhangg! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tiny things, super close now :D
Cool! I'm 100% convinced this is the best approach. Thanks for the explanation! |
graph TD;
A(Existing orphan record in redis)--without lock-->A1;
A1[Two Lambda invoke at same time]-->B1[Lambda handler1];
B1-->B2[Fetch from Redis];
B2-->B3[Handler1 got orphan record];
B3-->B4[Handler1 overwrite orphan record];
B4-->B5[Handler1 continue to execution];
A1-->C1[Lambda handler2];
C1-->C2[Fetch from Redis];
C2-->C3[Handler2 got orphan record];
C3-->C4[Handler2 overwrite orphan record];
C4-->C5[Handler2 continue to execution];
B5-->D(Lambda handler executed twice!);
C5-->D;
graph TD;
A(Existing orphan record in redis)--with lock-->A1;
A1[Two Lambda invoke at same time]-->B1[Lambda handler1];
B1-->B2[Fetch from Redis];
B2-->B3[Handler1 got orphan record];
B3-->B4[Handler1 acquired lock];
B4-->B5[Handler1 overwrite orphan record]
B5-->B6[Handler1 continue to execution];
A1-->C1[Lambda handler2];
C1-->C2[Fetch from Redis];
C2-->C3[Handler2 got orphan record];
C3-->C4[Handler2 failed to acquire lock];
C4-->C5[Handler2 wait and fetch from Redis];
C5-->C6[Handler2 return without executing];
B6-->D(Lambda handler executed only once!);
C6-->D;
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some small things left
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome work everyone!
Quality Gate passedThe SonarCloud Quality Gate passed, but some issues were introduced. 6 New issues |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APPROVED!
Issue number: #1181
previous pr: #1914
Summary
PR adds support for Redis as Idempotecny backend
Changes
The following features for Redis are currently supported by this PR
User experience
User can now use Redis as backend. You can connect it using Redis Standalone or Redis Cluster as shown in the example.
Checklist
If your change doesn't seem to apply, please leave them unchecked.
Is this a breaking change?
RFC issue number:
Checklist:
Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.