Browse Source

remove per-message debug logs

pull/5890/head
chrislu 7 months ago
parent
commit
d1f0c40402
  1. 4
      weed/mq/broker/broker_grpc_sub.go
  2. 2
      weed/mq/broker/broker_grpc_sub_follow.go
  3. 5
      weed/mq/sub_coordinator/inflight_message_tracker.go

4
weed/mq/broker/broker_grpc_sub.go

@ -112,7 +112,7 @@ func (b *MessageQueueBroker) SubscribeMessage(stream mq_pb.SeaweedMessaging_Subs
} }
imt.AcknowledgeMessage(ack.GetAck().Key, ack.GetAck().Sequence) imt.AcknowledgeMessage(ack.GetAck().Key, ack.GetAck().Sequence)
currentLastOffset := imt.GetOldestAckedTimestamp() currentLastOffset := imt.GetOldestAckedTimestamp()
fmt.Printf("%+v recv (%s,%d), oldest %d\n", partition, string(ack.GetAck().Key), ack.GetAck().Sequence, currentLastOffset)
// fmt.Printf("%+v recv (%s,%d), oldest %d\n", partition, string(ack.GetAck().Key), ack.GetAck().Sequence, currentLastOffset)
if subscribeFollowMeStream != nil && currentLastOffset > lastOffset { if subscribeFollowMeStream != nil && currentLastOffset > lastOffset {
if err := subscribeFollowMeStream.Send(&mq_pb.SubscribeFollowMeRequest{ if err := subscribeFollowMeStream.Send(&mq_pb.SubscribeFollowMeRequest{
Message: &mq_pb.SubscribeFollowMeRequest_Ack{ Message: &mq_pb.SubscribeFollowMeRequest_Ack{
@ -125,7 +125,7 @@ func (b *MessageQueueBroker) SubscribeMessage(stream mq_pb.SeaweedMessaging_Subs
break break
} }
lastOffset = currentLastOffset lastOffset = currentLastOffset
fmt.Printf("%+v forwarding ack %d\n", partition, lastOffset)
// fmt.Printf("%+v forwarding ack %d\n", partition, lastOffset)
} }
} }
if lastOffset > 0 { if lastOffset > 0 {

2
weed/mq/broker/broker_grpc_sub_follow.go

@ -42,7 +42,7 @@ func (b *MessageQueueBroker) SubscribeFollowMe(stream mq_pb.SeaweedMessaging_Sub
// Process the received message // Process the received message
if ackMessage := req.GetAck(); ackMessage != nil { if ackMessage := req.GetAck(); ackMessage != nil {
lastOffset = ackMessage.TsNs lastOffset = ackMessage.TsNs
println("sub follower got offset", lastOffset)
// println("sub follower got offset", lastOffset)
} else if closeMessage := req.GetClose(); closeMessage != nil { } else if closeMessage := req.GetClose(); closeMessage != nil {
glog.V(0).Infof("topic %v partition %v subscribe stream closed: %v", initMessage.Topic, initMessage.Partition, closeMessage) glog.V(0).Infof("topic %v partition %v subscribe stream closed: %v", initMessage.Topic, initMessage.Partition, closeMessage)
return nil return nil

5
weed/mq/sub_coordinator/inflight_message_tracker.go

@ -1,7 +1,6 @@
package sub_coordinator package sub_coordinator
import ( import (
"fmt"
"sort" "sort"
"sync" "sync"
) )
@ -22,7 +21,7 @@ func NewInflightMessageTracker(capacity int) *InflightMessageTracker {
// EnflightMessage tracks the message with the key and timestamp. // EnflightMessage tracks the message with the key and timestamp.
// These messages are sent to the consumer group instances and waiting for ack. // These messages are sent to the consumer group instances and waiting for ack.
func (imt *InflightMessageTracker) EnflightMessage(key []byte, tsNs int64) { func (imt *InflightMessageTracker) EnflightMessage(key []byte, tsNs int64) {
fmt.Printf("EnflightMessage(%s,%d)\n", string(key), tsNs)
// fmt.Printf("EnflightMessage(%s,%d)\n", string(key), tsNs)
imt.mu.Lock() imt.mu.Lock()
defer imt.mu.Unlock() defer imt.mu.Unlock()
imt.messages[string(key)] = tsNs imt.messages[string(key)] = tsNs
@ -53,7 +52,7 @@ func (imt *InflightMessageTracker) IsMessageAcknowledged(key []byte, tsNs int64)
// AcknowledgeMessage acknowledges the message with the key and timestamp. // AcknowledgeMessage acknowledges the message with the key and timestamp.
func (imt *InflightMessageTracker) AcknowledgeMessage(key []byte, tsNs int64) bool { func (imt *InflightMessageTracker) AcknowledgeMessage(key []byte, tsNs int64) bool {
fmt.Printf("AcknowledgeMessage(%s,%d)\n", string(key), tsNs)
// fmt.Printf("AcknowledgeMessage(%s,%d)\n", string(key), tsNs)
imt.mu.Lock() imt.mu.Lock()
defer imt.mu.Unlock() defer imt.mu.Unlock()
timestamp, exists := imt.messages[string(key)] timestamp, exists := imt.messages[string(key)]

Loading…
Cancel
Save