Skip to content

Commit

Permalink
Fix FAB-178 error not caught from StoreState
Browse files Browse the repository at this point in the history
Change-Id: I0afd9f844322be9463997dcb8004e15efee873c3
Signed-off-by: Christopher Ferris <chrisfer@us.ibm.com>
  • Loading branch information
christo4ferris authored and corecode committed Aug 22, 2016
1 parent 8ec1147 commit d1465b0
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions consensus/pbft/pbft-persist.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ func (instance *pbftCore) persistPSet() {
func (instance *pbftCore) persistPQSet(key string, set []*ViewChange_PQ) {
raw, err := proto.Marshal(&PQset{set})
if err != nil {
logger.Warningf("Replica %d could not persist pqset: %s", instance.id, err)
logger.Warningf("Replica %d could not persist pqset: %s: error: %s", instance.id, key, err)
return
}
instance.consumer.StoreState(key, raw)
err = instance.consumer.StoreState(key, raw)
if err != nil {
logger.Warningf("Replica %d could not persist pqset: %s: error: %s", instance.id, key, err)
}
}

func (instance *pbftCore) restorePQSet(key string) []*ViewChange_PQ {
Expand All @@ -74,7 +77,10 @@ func (instance *pbftCore) persistRequestBatch(digest string) {
logger.Warningf("Replica %d could not persist request batch %s: %s", instance.id, digest, err)
return
}
instance.consumer.StoreState("reqBatch."+digest, reqBatchPacked)
err = instance.consumer.StoreState("reqBatch."+digest, reqBatchPacked)
if err != nil {
logger.Warningf("Replica %d could not persist request batch %s: %s", instance.id, digest, err)
}
}

func (instance *pbftCore) persistDelRequestBatch(digest string) {
Expand All @@ -92,7 +98,10 @@ func (instance *pbftCore) persistDelAllRequestBatches() {

func (instance *pbftCore) persistCheckpoint(seqNo uint64, id []byte) {
key := fmt.Sprintf("chkpt.%d", seqNo)
instance.consumer.StoreState(key, id)
err := instance.consumer.StoreState(key, id)
if err != nil {
logger.Warningf("Could not persist Checkpoint %s: %s", key, err)
}
}

func (instance *pbftCore) persistDelCheckpoint(seqNo uint64) {
Expand Down

0 comments on commit d1465b0

Please sign in to comment.