Skip to content

Commit d1465b0

Browse files
christo4ferriscorecode
authored andcommitted
Fix FAB-178 error not caught from StoreState
Change-Id: I0afd9f844322be9463997dcb8004e15efee873c3 Signed-off-by: Christopher Ferris <[email protected]>
1 parent 8ec1147 commit d1465b0

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

consensus/pbft/pbft-persist.go

+13-4
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,13 @@ func (instance *pbftCore) persistPSet() {
4646
func (instance *pbftCore) persistPQSet(key string, set []*ViewChange_PQ) {
4747
raw, err := proto.Marshal(&PQset{set})
4848
if err != nil {
49-
logger.Warningf("Replica %d could not persist pqset: %s", instance.id, err)
49+
logger.Warningf("Replica %d could not persist pqset: %s: error: %s", instance.id, key, err)
5050
return
5151
}
52-
instance.consumer.StoreState(key, raw)
52+
err = instance.consumer.StoreState(key, raw)
53+
if err != nil {
54+
logger.Warningf("Replica %d could not persist pqset: %s: error: %s", instance.id, key, err)
55+
}
5356
}
5457

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

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

9399
func (instance *pbftCore) persistCheckpoint(seqNo uint64, id []byte) {
94100
key := fmt.Sprintf("chkpt.%d", seqNo)
95-
instance.consumer.StoreState(key, id)
101+
err := instance.consumer.StoreState(key, id)
102+
if err != nil {
103+
logger.Warningf("Could not persist Checkpoint %s: %s", key, err)
104+
}
96105
}
97106

98107
func (instance *pbftCore) persistDelCheckpoint(seqNo uint64) {

0 commit comments

Comments
 (0)