Skip to content

Commit

Permalink
[FAB-12014] Log warning for missing index
Browse files Browse the repository at this point in the history
Currently the warning is only seen in peer logs if couchdb debug is enabled.

Peer should log a warning without having to enable couchdb debug.

Log warning to peer when "no matching index found" warning comes from
couchdb queries.

Change-Id: I46a5fa663c502bbdf74261a4925ce54633384d1f
Signed-off-by: Chris Elder <chris.elder@us.ibm.com>
(cherry picked from commit 38430ad)
  • Loading branch information
Chris Elder authored and denyeart committed Sep 24, 2018
1 parent 47ba9b9 commit 9056520
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/ledger/util/couchdb/couchdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -1074,6 +1074,10 @@ func (dbclient *CouchDatabase) QueryDocuments(query string) (*[]QueryResult, err
return nil, err2
}

if jsonResponse.Warning != "" {
logger.Warningf("The query [%s] caused the following warning: [%s]", query, jsonResponse.Warning)
}

for _, row := range jsonResponse.Docs {

var docMetadata = &DocMetadata{}
Expand Down

0 comments on commit 9056520

Please sign in to comment.