From bb4d983e44d13570ea61d26c9a370088a3afcd60 Mon Sep 17 00:00:00 2001 From: Eray Arslan Date: Fri, 27 Oct 2023 00:12:30 +0300 Subject: [PATCH] feat: improve rollback mitigation log and vbucket discovery --- couchbase/rollback_mitigation.go | 15 +++++++++++++++ stream/vbucket_discovery.go | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/couchbase/rollback_mitigation.go b/couchbase/rollback_mitigation.go index 9138b6e..96ed3f6 100644 --- a/couchbase/rollback_mitigation.go +++ b/couchbase/rollback_mitigation.go @@ -3,7 +3,9 @@ package couchbase import ( "context" "errors" + "fmt" "reflect" + "strings" "time" "github.com/couchbase/gocbcore/v10" @@ -185,6 +187,19 @@ func (r *rollbackMitigation) startObserve(groupID int) { uuIDMap[vbID] = failoverLogs[0].VbUUID + var failoverInfos []string + for index, failoverLog := range failoverLogs { + failoverInfos = append( + failoverInfos, + fmt.Sprintf("index: %v, vbUUID: %v, seqNo: %v", index, failoverLog.VbUUID, failoverLog.SeqNo), + ) + } + + logger.Log.Debug( + "observing vbID: %v, vbUUID: %v, failoverInfo: %v", + vbID, uuIDMap[vbID], strings.Join(failoverInfos, ", "), + ) + return true }) diff --git a/stream/vbucket_discovery.go b/stream/vbucket_discovery.go index 36ce1ff..6c8d18a 100644 --- a/stream/vbucket_discovery.go +++ b/stream/vbucket_discovery.go @@ -49,7 +49,7 @@ func (s *vBucketDiscovery) Get() []uint16 { start := readyToStreamVBuckets[0] end := readyToStreamVBuckets[len(readyToStreamVBuckets)-1] - logger.Log.Debug( + logger.Log.Info( "member: %v/%v, vbucket range: %v-%v", receivedInfo.MemberNumber, receivedInfo.TotalMembers, start, end,