Skip to content

Conversation

@RIT3shSapata
Copy link
Contributor

CBG-4286

Describe your PR here...

  • Added prefix to DCP feed names as per KV conventions

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

Dependencies (if applicable)

  • Link upstream PRs
  • Update Go module dependencies when merged

Integration Tests

@RIT3shSapata RIT3shSapata requested a review from bbrks December 2, 2025 14:06
Copilot AI review requested due to automatic review settings December 2, 2025 14:06
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds the "sg:" prefix to DCP feed names to align with KV (Key-Value) naming conventions. This is a targeted change that standardizes the naming format for Sync Gateway's DCP stream identifiers.

Key Changes

  • Modified the DCP stream name format string to include the "sg:" prefix

Copy link
Collaborator

@torcolvin torcolvin left a comment

Choose a reason for hiding this comment

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

I think this is going to add "sg" to places where SG is already set -

See how this is called through db/import_listener.go and db/change_listener.go

I do try to fix this in #7879 but not entirely.

A good way to see what it used is to add print debugging

dc.agent, agentErr = gocbcore.CreateDcpAgent(agentConfig, dc.ID, flags)
to see the ID and run the integration tests (unfortunately this is SG_TEST_BACKING_STORE=couchbase until #7879, so you could wait for this PR)

The other place this is used is by cbgt for EE import feed https://github.com/couchbase/cbgt/blob/74dbd1c34db313c2b65a65f6e3cecca7eacb00b3/gocbcore_agents.go#L232

It would be good to know the names for each of the dcp feed types we run:

  • import feed
  • caching feed
  • resync background process
  • attachment migration background process
  • attachment compaction background process

I think that we sort of mix and match names and versions in this.

The other thing I think this PR should do is actually check the value will be <200, since this

const maxDCPNameLength = 200
tests in the non production case.

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.

4 participants