Skip to content

CBG-5175: resync - purge checkpoints if needed#8233

Open
torcolvin wants to merge 5 commits intomainfrom
CBG-5175
Open

CBG-5175: resync - purge checkpoints if needed#8233
torcolvin wants to merge 5 commits intomainfrom
CBG-5175

Conversation

@torcolvin
Copy link
Copy Markdown
Collaborator

CBG-5175: resync - purge checkpoints if needed

Create a function to PurgeShardedDCPCheckpoints that can be called when necessary. Currently wired up to purge whenever we purged the existing code. I tried this style of purging for attachment migration and compaction and somehow some subtle timing differences surface bugs in the code I don't want to uncover. There's a future jira ticket for this.

It's expected that in Sync Gateway 4.1, EE will use distributed mode and CE will use non distributed mode which is why both pathways are present.

I do not yet purge the checkpoints when the feed completes normally as I do not have the code in cbgt or hooks to determine when that is.

Pre-review checklist

  • Removed debug logging (fmt.Print, log.Print, ...)
  • Logging sensitive data? Make sure it's tagged (e.g. base.UD(docID), base.MD(dbName))
  • Updated relevant information in the API specifications (such as endpoint descriptions, schemas, ...) in docs/api

Integration Tests

}
checkpointPrefix := GetResyncDCPCheckpointPrefix(db.DatabaseContext, resyncID, r.Distributed)
if !r.Distributed {
dcpClient, err := r.newDCPClient(ctx, db, false)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

newDCPClient seems like it does a decent amount of setup work (including loading and initializing metadata from the checkpoints we're about to delete). Is this just to handle the differences in purge between Rosmar and Gocb implementations?

Any way of having an equivalent function to base.PurgeShardedDCPCheckpoints for non-sharded feeds that accepts a MetadataStore and numWorkers?

@adamcfraser adamcfraser assigned torcolvin and unassigned adamcfraser May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants