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

Add check for invalid key before hitting couchdb #2133

Merged
merged 1 commit into from
Nov 17, 2020

Conversation

manish-sethi
Copy link
Contributor

Signed-off-by: manish manish.sethi@gmail.com

Type of change

  • Bug fix

Related issues

FAB-13897

FAB-13897

Signed-off-by: manish <manish.sethi@gmail.com>
@manish-sethi manish-sethi requested a review from a team as a code owner November 17, 2020 15:16
Comment on lines +529 to +531
if err := validateKey(key); err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

If the goal is to avoid sending invalid keys to CouchDB but not to the cache, this PR LGTM. Is that the goal? If not, we need to perform this check before accessing the cache also.

Copy link
Contributor Author

@manish-sethi manish-sethi Nov 17, 2020

Choose a reason for hiding this comment

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

Cache would eventually be populated from DB content only. So, checking in cache does not add any value. Rather, in the current way, it amortizes the cost of this check.

@cendhu cendhu merged commit 5f2034f into hyperledger:master Nov 17, 2020
@denyeart
Copy link
Contributor

@Mergifyio backport release-2.2

@mergify
Copy link

mergify bot commented Nov 17, 2020

Command backport release-2.2: success

Backports have been created

mergify bot pushed a commit that referenced this pull request Nov 17, 2020
FAB-13897

Signed-off-by: manish <manish.sethi@gmail.com>
(cherry picked from commit 5f2034f)

# Conflicts:
#	core/ledger/kvledger/txmgmt/statedb/statecouchdb/statecouchdb_test.go
denyeart pushed a commit to denyeart/fabric that referenced this pull request Nov 17, 2020
FAB-13897

Signed-off-by: manish <manish.sethi@gmail.com>
Signed-off-by: David Enyeart <enyeart@us.ibm.com>
manish-sethi added a commit that referenced this pull request Nov 17, 2020
FAB-13897

Signed-off-by: manish <manish.sethi@gmail.com>
Signed-off-by: David Enyeart <enyeart@us.ibm.com>

Co-authored-by: Manish Sethi <manish.sethi@gmail.com>
@manish-sethi manish-sethi deleted the FAB-13897 branch November 17, 2020 21:00
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.

3 participants