Skip to content

Commit 5f13320

Browse files
torcolvinCopilot
andauthored
Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent 662f58c commit 5f13320

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

base/dcp_feed_type.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ type SGFeedIndexParams struct {
166166
DestKey string `json:"destKey,omitempty"`
167167
}
168168

169-
// cbgtFeedParams returns marshalled cbgt.DCPFeedParams as string. This contains information to for a given information , to be passed as feedparams during cbgt.Manager init.
170-
func cbgtFeedParams(ctx context.Context, opts ShardedDCPOptions) (string, error) {
169+
// cbgtFeedParams returns a JSON-encoded SGFeedSourceParams string to be passed as cbgt feed sourceParams.
170+
// It includes the SG database name, optional scope/collections, and (when opts.EndSeqNos is set) StopAfter/MarkPartitionSeqs for one-shot feeds.
171171
feedParams := &SGFeedSourceParams{
172172
DbName: opts.DBName,
173173
DCPFeedParams: cbgt.DCPFeedParams{

base/dcp_sharded.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,8 +929,7 @@ type sgMgrEventHandlers struct {
929929
ctx context.Context
930930
ctxCancel context.CancelCauseFunc
931931
manager *cbgt.Manager
932-
unregisterFeedCallback func(cbgt.Feed) // callback function for when a feed is unregistered. This occurs when a feed completes for any reason: Stop is requested, a rebalance of partitions, the feed naturally ends when reaching expected seequence numbers.
933-
}
932+
unregisterFeedCallback func(cbgt.Feed) // callback function for when a feed is unregistered. This occurs when a feed completes for any reason: Stop is requested, a rebalance of partitions, or the feed naturally ends when reaching expected sequence numbers.
934933

935934
func (meh *sgMgrEventHandlers) OnRefreshManagerOptions(options map[string]string) {
936935
// No-op for SG

db/background_mgr_resync_dcp.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,9 @@ func (r *ResyncManagerDCP) GetProcessStatus(status BackgroundManagerStatus, prev
638638
// doneChan when all vBuckets have completed, which will allow the resync process to finish.
639639
func (r *ResyncManagerDCP) getUnregisterFeedFunc(ctx context.Context, totalVBuckets uint16) base.CbgtUnregisterFeedCallback {
640640
return func(feed cbgt.Feed) {
641-
for _, d := range feed.Dests() {
642-
d, ok := d.(base.SGDest)
643-
if !ok {
644-
base.AssertfCtx(ctx, "Expected dest on cbgt.EventHandler.OnUnregisterFeed to be of type SGDest but is of type %T, resync will can complete but checkpoints may not be written", d)
641+
for _, dest := range feed.Dests() {
642+
if _, ok := dest.(base.SGDest); !ok {
643+
base.AssertfCtx(ctx, "Expected dest on cbgt.EventHandler.OnUnregisterFeed to be of type SGDest but is of type %T; resync can complete but checkpoints may not be written", dest)
645644
}
646645
}
647646
f, ok := feed.(cbgt.FeedPartitionCompletion)

0 commit comments

Comments
 (0)