Skip to content

Treat etag errors across all state stores#579

Merged
artursouza merged 3 commits into
dapr:masterfrom
yaron2:etagerror-1
Jan 9, 2021
Merged

Treat etag errors across all state stores#579
artursouza merged 3 commits into
dapr:masterfrom
yaron2:etagerror-1

Conversation

@yaron2

@yaron2 yaron2 commented Jan 9, 2021

Copy link
Copy Markdown
Member

This PR consolidates error handling for possible etag mismach and invalid etags across all state stores.

Partially closes dapr/dapr#2619

@yaron2
yaron2 requested a review from artursouza January 9, 2021 01:15
@codecov

codecov Bot commented Jan 9, 2021

Copy link
Copy Markdown

Codecov Report

Merging #579 (fa0b16f) into master (d7eeb24) will increase coverage by 0.04%.
The diff coverage is 35.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #579      +/-   ##
==========================================
+ Coverage   30.57%   30.61%   +0.04%     
==========================================
  Files          84       85       +1     
  Lines        7065     7107      +42     
==========================================
+ Hits         2160     2176      +16     
- Misses       4673     4697      +24     
- Partials      232      234       +2     
Impacted Files Coverage Δ
state/azure/blobstorage/blobstorage.go 32.00% <0.00%> (-1.34%) ⬇️
state/azure/tablestorage/tablestorage.go 14.73% <0.00%> (-1.00%) ⬇️
state/postgresql/postgresdbaccess.go 0.00% <0.00%> (ø)
state/sqlserver/sqlserver.go 30.80% <0.00%> (-0.57%) ⬇️
state/couchbase/couchbase.go 20.19% <14.28%> (-0.81%) ⬇️
state/aerospike/aerospike.go 19.64% <20.00%> (-0.36%) ⬇️
state/redis/redis.go 27.74% <25.00%> (-0.33%) ⬇️
state/zookeeper/zk.go 66.90% <60.00%> (-1.04%) ⬇️
state/errors.go 100.00% <100.00%> (ø)

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 d7eeb24...fa0b16f. Read the comment docs.

@artursouza
artursouza merged commit 4d3e1be into dapr:master Jan 9, 2021
@yaron2
yaron2 deleted the etagerror-1 branch January 9, 2021 05:27
err := r.writeRow(req)
if req.ETag != "" {
return state.NewETagError(state.ETagMismatch, err)
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@yaron2 - can you explain how this works? I'm not familiar with those code but it looks like this would return state.NewETagError every time an ETag is specified.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Theres an err check missing here, I'll push a fix later

kumaya pushed a commit to infobloxopen/components-contrib that referenced this pull request Feb 19, 2021
* treat etag errors across all state stores

* linter

* linter
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.

Return HTTP 409 Conflict when ETag doesn't match

3 participants