Skip to content

Commit

Permalink
feat: improve rollback mitigation log and vbucket discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
erayarslan committed Oct 26, 2023
1 parent 0013220 commit bb4d983
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions couchbase/rollback_mitigation.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package couchbase
import (
"context"
"errors"
"fmt"
"reflect"
"strings"
"time"

"github.com/couchbase/gocbcore/v10"
Expand Down Expand Up @@ -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
})

Expand Down
2 changes: 1 addition & 1 deletion stream/vbucket_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit bb4d983

Please sign in to comment.