CBG-5153: Implement resync using CBGT for a single node#8057
CBG-5153: Implement resync using CBGT for a single node#8057RIT3shSapata wants to merge 5 commits intomainfrom
Conversation
torcolvin
left a comment
There was a problem hiding this comment.
A few comments before I look more, I think the test is passing right now because it starts the non distributed resync.
torcolvin
left a comment
There was a problem hiding this comment.
I gave a non exhaustive review for any cases where import was used for code, but I don't think I found all cases. Definitely give a look through the code pathways to see if you can find other locations.
| // StartShardedDCPFeed initializes and starts a CBGT Manager targeting the provided bucket. | ||
| // dbName is used to define a unique path name for local file storage of pindex files | ||
| func StartShardedDCPFeed(ctx context.Context, dbName string, configGroup string, uuid string, heartbeater Heartbeater, bucket Bucket, spec BucketSpec, scope string, collections []string, numPartitions uint16, cfg cbgt.Cfg) (*CbgtContext, error) { | ||
| func StartShardedDCPFeed(ctx context.Context, dbName string, configGroup string, uuid string, heartbeater Heartbeater, bucket Bucket, spec BucketSpec, scope string, collections []string, numPartitions uint16, cfg cbgt.Cfg, resyncIndex bool) (*CbgtContext, error) { |
There was a problem hiding this comment.
This could take DestType instead of a boolean parameter, which would be generally preferred since it would be more reasonable. The name DestType might not be appropriate, but it could be ShardedDCPFeedType instead?
It might be worth figuring out below what is actually needed to do to split on the feed type and whether to pass these arguments into this function or pass a type parameter. Review this comment after looking through the rest of the code and the comments.
| return err | ||
| } | ||
| if r.Distributed { | ||
| resyncCbgtContext.Stop() |
There was a problem hiding this comment.
I think that the context needs to be stopped if there are any errors earlier, see also for the heartbeat prefix.
CBG-5153
DRAFT PR
Describe your PR here...
Pre-review checklist
fmt.Print,log.Print, ...)base.UD(docID),base.MD(dbName))docs/apiDependencies (if applicable)
Integration Tests
GSI=true,xattrs=truehttps://jenkins.sgwdev.com/job/SyncGatewayIntegration/0000/