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 <[email protected]>
  • Loading branch information
Chris Elder committed Sep 14, 2018
1 parent 49df128 commit 38430ad
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 @@ -1076,6 +1076,10 @@ func (dbclient *CouchDatabase) QueryDocuments(query string) ([]*QueryResult, str
return nil, "", errors.Wrap(err2, "error unmarshalling json data")
}

if jsonResponse.Warning != "" {
logger.Warnf("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 38430ad

Please sign in to comment.