Commit c51d6a90 authored by yacovm's avatar yacovm Committed by Yacov Manevich
Browse files

[FAB-14690] Debug logs in gossip pull



This change set adds some more debug logs in the gossip pull
for blocks.

Change-Id: I9f2d3609c2ba5aba3e06d3741c061ce6e7bc90f0
Signed-off-by: default avataryacovm <yacovm@il.ibm.com>
(cherry picked from commit ceef61fb282e645dc2b6b5d043ef5b45b7e41ffe)
parent 343957a8
......@@ -202,8 +202,10 @@ func NewGossipChannel(pkiID common.PKIidType, org api.OrgIdentityType, mcs api.M
return fmt.Sprintf("%d", m.(*proto.SignedGossipMessage).GetDataMsg().Payload.SeqNum)
}
gc.blockMsgStore = msgstore.NewMessageStoreExpirable(comparator, func(m interface{}) {
gc.logger.Debugf("Removing %s from the message store", seqNumFromMsg(m))
gc.blocksPuller.Remove(seqNumFromMsg(m))
}, gc.GetConf().BlockExpirationInterval, nil, nil, func(m interface{}) {
gc.logger.Debugf("Removing %s from the message store", seqNumFromMsg(m))
gc.blocksPuller.Remove(seqNumFromMsg(m))
})
......@@ -502,6 +504,7 @@ func (gc *gossipChannel) AddToMsgStore(msg *proto.SignedGossipMessage) {
if msg.IsDataMsg() {
added := gc.blockMsgStore.Add(msg)
if added {
gc.logger.Debugf("Adding %v to the block puller", msg)
gc.blocksPuller.Add(msg)
}
}
......@@ -597,6 +600,7 @@ func (gc *gossipChannel) HandleMessage(msg proto.ReceivedMessage) {
gc.DeMultiplex(m)
if m.IsDataMsg() {
gc.logger.Debugf("Adding %v to the block puller", msg.GetGossipMessage())
gc.blocksPuller.Add(msg.GetGossipMessage())
}
}
......
......@@ -198,6 +198,7 @@ func (p *pullMediatorImpl) HandleMessage(m proto.ReceivedMessage) {
items[i] = msg
p.Lock()
p.itemID2Msg[itemIDs[i]] = msg
p.logger.Debugf("Added %s to the in memory item map, total items: %d", itemIDs[i], len(p.itemID2Msg))
p.Unlock()
}
p.engine.OnRes(itemIDs, res.Nonce)
......@@ -228,6 +229,7 @@ func (p *pullMediatorImpl) Add(msg *proto.SignedGossipMessage) {
itemID := p.IdExtractor(msg)
p.itemID2Msg[itemID] = msg
p.engine.Add(itemID)
p.logger.Debugf("Added %s, total items: %d", itemID, len(p.itemID2Msg))
}
// Remove removes a GossipMessage from the Mediator with a matching digest,
......@@ -237,6 +239,7 @@ func (p *pullMediatorImpl) Remove(digest string) {
defer p.Unlock()
delete(p.itemID2Msg, digest)
p.engine.Remove(digest)
p.logger.Debugf("Removed %s, total items: %d", digest, len(p.itemID2Msg))
}
// SelectPeers returns a slice of peers which the engine will initiate the protocol with
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment