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

Use concurrency control in Redis store's Multi() #466

Merged
merged 3 commits into from
Sep 22, 2020
Merged

Use concurrency control in Redis store's Multi() #466

merged 3 commits into from
Sep 22, 2020

Conversation

tcnghia
Copy link
Member

@tcnghia tcnghia commented Sep 22, 2020

Description

Change Multi() to use same setQuery and delQuery mechanisms as Set() and Delete().

Issue reference

Please reference the issue this PR will close: #375

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation / Created issue in the https://github.com/dapr/docs/ repo: dapr/docs#[issue number]

@tcnghia tcnghia changed the title Use concurrency control in Multi(). Use concurrency control in Multi() Sep 22, 2020
@tcnghia tcnghia changed the title Use concurrency control in Multi() Use concurrency control in Redis store's Multi() Sep 22, 2020
@tcnghia tcnghia marked this pull request as ready for review September 22, 2020 19:55
@youngbupark
Copy link
Contributor

LGTM. thanks for the cleaning up the code as well.
Please do backward compat test similar to the below scenario manually.

with 0.10.0 dapr

  1. dapr uninstall --all
  2. dapr init
  3. dapr run
  4. call transaction api to save teststate state with oldvalue value

with your change

  1. build new daprd with your change
  2. copy new daprd build to ~/.dapr/bin/
  3. dapr run
  4. call get state api to get teststate state
  5. ensure that returned state value is oldvalue
  6. call transaction api to save teststate state with newvalue value
  7. call get state api to get teststate state
  8. ensure the returned state value is newvalue

Copy link
Contributor

@youngbupark youngbupark left a comment

Choose a reason for hiding this comment

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

please run the backward compat test before merging.

@tcnghia
Copy link
Member Author

tcnghia commented Sep 22, 2020

@youngbupark thanks for the instruction. I've confirmed backward compat using that sequence.

@codecov
Copy link

codecov bot commented Sep 22, 2020

Codecov Report

Merging #466 into master will increase coverage by 0.27%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #466      +/-   ##
==========================================
+ Coverage   28.27%   28.54%   +0.27%     
==========================================
  Files          79       79              
  Lines        6263     6263              
==========================================
+ Hits         1771     1788      +17     
+ Misses       4296     4273      -23     
- Partials      196      202       +6     
Impacted Files Coverage Δ
state/redis/redis.go 25.14% <75.00%> (+9.14%) ⬆️
state/cloudstate/cloudstate_crdt.go 9.05% <0.00%> (+0.43%) ⬆️

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 e5a50cb...16d6224. Read the comment docs.

@tcnghia tcnghia merged commit e51cff7 into dapr:master Sep 22, 2020
tcnghia added a commit to tcnghia/dapr that referenced this pull request Sep 22, 2020
tcnghia added a commit to dapr/dapr that referenced this pull request Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi() transaction operations api for redis should use HSET or HDEL
2 participants