It seems like I misunderstand how Hyperledger Fabric processes a query. I'm currently using the fabric-go-sdk to query an asset from the ledger like
asset, err := client.Query(channel.Request{ChaincodeID: someCCname, Fcn: "query", Args: [][]byte{[]byte(someID)}})
When my system is under load (many new transactions that are unrelated to the query) I sometimes get the following error message:
endorsement validation failed: Endorser Client Status Code: (3) ENDORSEMENT_MISMATCH. Description: ProposalResponsePayloads do not match.
Why is an endorsement involved if data is only queried? To me the error message seems to indicate that multiple peers answered differently to the query. Does that mean that some peers have the asset already committed into the ledger while others do not? It is noteworthy that the query is ran very shortly after the asset is created and does not happen consistently.
The query chaincode is very straight-forward and minimal:
func (c *TestChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response {
data, err := stub.GetState(args[0])
if err != nil {
return shim.Error(err)
}
if data== nil {
return shim.Error(err)
}
return shim.Success(data)
}