Skip to content

CBG 5979: Config to enable channel history compaction - #8947

Merged
bbrks merged 1 commit into
mainfrom
CBG-5979
Oct 22, 2026
Merged

bbrks merged 1 commit into
mainfrom
CBG-5979

Conversation

@RIT3shSapata

@RIT3shSapata RIT3shSapata commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

CBG-5979

Add the enable_channel_history_compaction database configuration option, with a default of false. This PR only adds the option.

  • Add EnableChannelHistoryCompaction to DbConfig and DatabaseContextOptions, and map it in dbcOptionsFromConfig.
  • Add the default to DefaultDbConfig, so _config?include_runtime=true shows false when the option is not set.
  • Let the option change freely after the database is created. validateChanges has no rule for it.
  • Add the option to the Database schema in docs/api.

Pre-review checklist

  • 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 review from bbrks and a balanced review from Copilot October 21, 2026 06:08
@RIT3shSapata RIT3shSapata self-assigned this Oct 21, 2026
@RIT3shSapata
RIT3shSapata requested a review from a team October 21, 2026 06:08
@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Redocly previews

@factory-droid

factory-droid Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Droid finished @RIT3shSapata's task —— View job


This PR is small and the plumbing for the new config flag looks straightforward. The main issue is that the OpenAPI schema text for enable_channel_history_compaction currently claims write-time behavior that is not implemented yet.

@RIT3shSapata
RIT3shSapata changed the base branch from main to CBG-5980 October 21, 2026 06:09
@RIT3shSapata
RIT3shSapata added this pull request to stack #8948 October 21, 2026 06:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Runtime configuration can report a stale partition window after refresh, and the new flag lacks focused regression coverage.

1 open issue
What changed in this PR

Adds an opt-in channel history compaction setting to Sync Gateway; document-write compaction remains deferred.

Changes:

  • Adds the configuration flag, defaulting to false, and maps it into database options.
  • Documents the new setting.
  • Includes #8942’s purge-interval-based client partition defaults and runtime reporting tests.
File Description
rest/​server_context.go Maps configuration into database options.
rest/​config.go Defines the flag and updates partition-window documentation.
rest/​config_database.go Adds defaults and runtime window population.
rest/​config_database_test.go Allows the dynamically determined window default.
rest/​api_test.go Tests partition-window configuration reporting.
rest/​admin_api.go Populates runtime partition-window responses.
docs/​api/​components/​schemas.yaml Documents configuration options and defaults.
db/​database.go Adds the flag and purge-interval-based window resolution.
base/​constants.go Clarifies the test-only window default comment.

Review effort: Balanced

Comment thread rest/server_context.go
DisablePublicAllDocs: disablePublicAllDocs,
StoreLegacyRevTreeData: new(base.ValDefault(config.StoreLegacyRevTreeData, db.DefaultStoreLegacyRevTreeData)),
UseSystemMetadataCollection: useMobileCollection,
EnableChannelHistoryCompaction: base.ValDefault(config.EnableChannelHistoryCompaction, DefaultEnableChannelHistoryCompaction),
Comment thread docs/api/components/schemas.yaml Resolved
@RIT3shSapata
RIT3shSapata removed this pull request from stack #8948 October 21, 2026 11:30
@RIT3shSapata
RIT3shSapata changed the base branch from CBG-5980 to main October 21, 2026 11:30
@RIT3shSapata RIT3shSapata assigned bbrks and unassigned RIT3shSapata Oct 21, 2026
@bbrks
bbrks merged commit cbbbfb8 into main Oct 22, 2026
55 checks passed
@bbrks
bbrks deleted the CBG-5979 branch October 22, 2026 11:50
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.

3 participants