-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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
Conversation
FAB-13897 Signed-off-by: manish <manish.sethi@gmail.com>
if err := validateKey(key); err != nil { | ||
return nil, err | ||
} |
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.
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.
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.
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.
@Mergifyio backport release-2.2 |
Command
|
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
FAB-13897 Signed-off-by: manish <manish.sethi@gmail.com> Signed-off-by: David Enyeart <enyeart@us.ibm.com>
Signed-off-by: manish manish.sethi@gmail.com
Type of change
Related issues
FAB-13897