Skip to content

CBG-5715: correct documented defaults and bounds - #8656

Open
torcolvin wants to merge 2 commits into
CBG-5715-07-compact-status-phasefrom
CBG-5715-08-defaults-and-bounds
Open

CBG-5715: correct documented defaults and bounds#8656
torcolvin wants to merge 2 commits into
CBG-5715-07-compact-status-phasefrom
CBG-5715-08-defaults-and-bounds

Conversation

@torcolvin

@torcolvin torcolvin commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

CBG-5715

Split out of #8589 — stack 8/9, based on #8655.

  • javascript_timeout_secs documented a default of 60, but base.DefaultJavascriptTimeoutSecs is 0 (uncapped) — base/constants.go:148.
  • revs_limit documented minimum: 0, which config validation rejects ("must be greater than zero") — rest/config.go:943. Use 1, and note the higher floor and different default that apply when allow_conflicts is enabled (rest/config.go:938 requires >= 20; db/database.go:66-67 defaults 50 vs 100).
  • The stats logger's max_age documented a default of 6. Unlike the other loggers it does not derive its default from minAge; it uses the fixed statsDefaultMaxAgeOverride of 90 — base/logging_config.go:36.

The error/warn/info/debug/trace and audit max_age defaults were checked against their minAge constants and are correct, so they are left alone.

Pre-review checklist

  • Logging sensitive data? N/A — docs only
  • Updated relevant information in the API specifications in docs/api

🤖 Generated with Claude Code

@factory-droid

factory-droid Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Droid finished @torcolvin's task —— View job


Docs-only change looks largely consistent with current code defaults, but the revs_limit description currently references an allow_conflicts-enabled mode that config validation disallows, which can mislead API consumers.

Comment thread docs/api/components/schemas.yaml Outdated
@torcolvin
torcolvin requested a review from a team August 23, 2026 18:33
@torcolvin
torcolvin force-pushed the CBG-5715-08-defaults-and-bounds branch from f4492d6 to aa32138 Compare August 23, 2026 18:33
@github-actions

github-actions Bot commented Aug 23, 2026

Copy link
Copy Markdown

Redocly previews

torcolvin added a commit that referenced this pull request Aug 23, 2026
max_processes is a uint, and db/event_manager.go:69-70 maps 0 to
kMaxActiveEvents (500), so document minimum: 0 with the effective
default and say what 0 means.  Raised by Copilot on #8654.

heartbeat and timeout in the _changes POST bodies now carry the same
defaults and bounds already documented on the GET query parameters:
heartbeat defaults to 0 and, when non-zero, is clamped up to
kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000)
and is capped at kMaxTimeoutMS (900000).  See GetRestrictedInt, which
readChangesOptionsFromJSON calls with allowZero=true.  Copilot flagged
these as heartbeat-only, but the timeout default is 300000, not 0.

Also drops the revs_limit allow_conflicts note.  Both branches it
describes exist (db/database.go:504-508, rest/config.go:936-940) but
neither is reachable from config: allow_conflicts=true is rejected in
the same validateVersion (rest/config.go:1149-1150) and
DefaultAllowConflicts is false, so only the test-only
EnableAllowConflicts gets there.  Raised by @factory-droid on #8656.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin force-pushed the CBG-5715-08-defaults-and-bounds branch from aa32138 to 8617f4c Compare August 23, 2026 18:44
Copilot AI lite review requested due to automatic review settings August 23, 2026 18:44

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.

Pull request overview

Updates OpenAPI documentation to align documented defaults and validation bounds with runtime behavior.

Changes:

  • Corrects changes-feed timeout and heartbeat documentation.
  • Updates JavaScript, event-process, revision-limit, and stats-log defaults.
  • Adjusts revision-limit minimums and configuration metadata.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Summary
docs/api/paths/public/keyspace-_changes.yaml Updates public changes-feed defaults and bounds.
docs/api/paths/admin/keyspace-_changes.yaml Updates admin changes-feed defaults and bounds.
docs/api/components/schemas.yaml Corrects database and logging configuration documentation; a minor note requests documenting conditional revs_limit values for conflict-enabled databases.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/api/components/schemas.yaml
@torcolvin
torcolvin requested a review from bbrks August 24, 2026 17:08
torcolvin added a commit that referenced this pull request Aug 24, 2026
max_processes is a uint, and db/event_manager.go:69-70 maps 0 to
kMaxActiveEvents (500), so document minimum: 0 with the effective
default and say what 0 means.  Raised by Copilot on #8654.

heartbeat and timeout in the _changes POST bodies now carry the same
defaults and bounds already documented on the GET query parameters:
heartbeat defaults to 0 and, when non-zero, is clamped up to
kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000)
and is capped at kMaxTimeoutMS (900000).  See GetRestrictedInt, which
readChangesOptionsFromJSON calls with allowZero=true.  Copilot flagged
these as heartbeat-only, but the timeout default is 300000, not 0.

Also drops the revs_limit allow_conflicts note.  Both branches it
describes exist (db/database.go:504-508, rest/config.go:936-940) but
neither is reachable from config: allow_conflicts=true is rejected in
the same validateVersion (rest/config.go:1149-1150) and
DefaultAllowConflicts is false, so only the test-only
EnableAllowConflicts gets there.  Raised by @factory-droid on #8656.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin force-pushed the CBG-5715-08-defaults-and-bounds branch from 8617f4c to c6ce9ed Compare August 24, 2026 17:31
torcolvin added a commit that referenced this pull request Aug 24, 2026
max_processes is a uint, and db/event_manager.go:69-70 maps 0 to
kMaxActiveEvents (500), so document minimum: 0 with the effective
default and say what 0 means.  Raised by Copilot on #8654.

heartbeat and timeout in the _changes POST bodies now carry the same
defaults and bounds already documented on the GET query parameters:
heartbeat defaults to 0 and, when non-zero, is clamped up to
kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000)
and is capped at kMaxTimeoutMS (900000).  See GetRestrictedInt, which
readChangesOptionsFromJSON calls with allowZero=true.  Copilot flagged
these as heartbeat-only, but the timeout default is 300000, not 0.

Also drops the revs_limit allow_conflicts note.  Both branches it
describes exist (db/database.go:504-508, rest/config.go:936-940) but
neither is reachable from config: allow_conflicts=true is rejected in
the same validateVersion (rest/config.go:1149-1150) and
DefaultAllowConflicts is false, so only the test-only
EnableAllowConflicts gets there.  Raised by @factory-droid on #8656.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
torcolvin and others added 2 commits August 24, 2026 16:48
- `javascript_timeout_secs` documented a default of 60, but
  `base.DefaultJavascriptTimeoutSecs` is 0 (uncapped).
- `revs_limit` documented `minimum: 0`, which config validation rejects
  ("must be greater than zero"). Use 1, and note the higher floor and
  different default that apply when `allow_conflicts` is enabled.
- The stats logger's `max_age` documented a default of 6. Unlike the other
  loggers it does not derive its default from `minAge`; it uses the fixed
  `statsDefaultMaxAgeOverride` of 90. The error/warn/info/debug/trace and
  audit defaults were checked and are correct.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
max_processes is a uint, and db/event_manager.go:69-70 maps 0 to
kMaxActiveEvents (500), so document minimum: 0 with the effective
default and say what 0 means.  Raised by Copilot on #8654.

heartbeat and timeout in the _changes POST bodies now carry the same
defaults and bounds already documented on the GET query parameters:
heartbeat defaults to 0 and, when non-zero, is clamped up to
kMinHeartbeatMS (25000); timeout defaults to kDefaultTimeoutMS (300000)
and is capped at kMaxTimeoutMS (900000).  See GetRestrictedInt, which
readChangesOptionsFromJSON calls with allowZero=true.  Copilot flagged
these as heartbeat-only, but the timeout default is 300000, not 0.

Also drops the revs_limit allow_conflicts note.  Both branches it
describes exist (db/database.go:504-508, rest/config.go:936-940) but
neither is reachable from config: allow_conflicts=true is rejected in
the same validateVersion (rest/config.go:1149-1150) and
DefaultAllowConflicts is false, so only the test-only
EnableAllowConflicts gets there.  Raised by @factory-droid on #8656.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@torcolvin
torcolvin force-pushed the CBG-5715-08-defaults-and-bounds branch from c6ce9ed to 73c053a Compare August 24, 2026 20:50
@bbrks bbrks removed their assignment Aug 25, 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.

3 participants