-
Notifications
You must be signed in to change notification settings - Fork 144
CBG-5220: Freezable cluster compat version #8236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
01a13de
CBG-5220: Add REST API spec for cluster compat version freeze
bbrks 1f927cc
CBG-5220: Implement cluster compat version freeze
bbrks 653dbba
CBG-5220: Address review feedback on freeze
bbrks 6429105
goimports
bbrks d676c17
move test to non-race to support audit assertions
bbrks 345d2d8
CBG-5220: Prevent HWM from advancing past a freeze
bbrks d28abf6
CBG-5220: Make Freeze success-on-all with partial-failure response
bbrks 0d9e395
CBG-5220: Address review feedback on audit metadata and OpenAPI docs
bbrks 25652db
CBG-5220: Tighten Freeze/Unfreeze locking and audit fidelity
bbrks 6bcb38d
CBG-5220: Disambiguate Unfreeze partial-failure when residual state i…
bbrks fbe6107
CBG-5220: Defer HWM ratchet to post-StartOnlineProcesses
bbrks 9a7233d
CBG-5220: Gate HWM ratchet on live DB-online state, not a synchronous…
bbrks 6fb803f
CBG-5220: Preserve cached freeze when no bucket accepts a re-freeze
bbrks 57c5fa7
CBG-5220: Compute ratchet eligibility once per Refresh
bbrks 8e2a206
post-rebase fix
bbrks 0151115
address comments
bbrks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| # Copyright 2026-Present Couchbase, Inc. | ||
| # | ||
| # Use of this software is governed by the Business Source License included | ||
| # in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
| # in that file, in accordance with the Business Source License, use of this | ||
| # software will be governed by the Apache License, Version 2.0, included in | ||
| # the file licenses/APL2.txt. | ||
| post: | ||
| summary: Freeze the cluster compatibility version at its current value | ||
| description: |- | ||
| Captures the current cluster compatibility version and pins the cluster to this version. | ||
|
|
||
| While frozen, subsequent node upgrades will not advance the reported `cluster_compat_version`, preserving the option to roll a node back to the prior major/minor. | ||
|
|
||
| Returns success only if every tracked bucket accepts the freeze. | ||
| If one or more buckets fail to accept it, a `503` is returned with the current state — the cluster compatibility version may still be partially pinned, and the request should be retried. | ||
|
|
||
| To clear the pinned version, call `POST /_cluster_compat_version/unfreeze`. | ||
|
|
||
| Required Sync Gateway RBAC roles: | ||
|
|
||
| * Sync Gateway Dev Ops | ||
| responses: | ||
| '200': | ||
| description: Cluster compatibility version has been frozen | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/ClusterCompatVersionState | ||
| '403': | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| '500': | ||
| description: An unexpected error occurred while freezing the cluster compatibility version | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/HTTP-Error | ||
| '503': | ||
| description: |- | ||
| The freeze could not be fully applied. Possible reasons: | ||
| * Cluster compatibility version tracking is not enabled on this node. | ||
| * The cluster compatibility version has not yet been computed (e.g. immediately after startup). | ||
| * No tracked bucket registries. | ||
| * One or more tracked buckets did not accept the freeze (partial failure). In this case the response body is a `ClusterCompatVersionState` describing the version (if any) that is currently pinned, so the admin can see what did take effect. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| oneOf: | ||
| - $ref: ../../components/schemas.yaml#/HTTP-Error | ||
| - $ref: ../../components/schemas.yaml#/ClusterCompatVersionState | ||
| tags: | ||
| - Server | ||
| operationId: post__cluster_compat_version_freeze | ||
52 changes: 52 additions & 0 deletions
52
docs/api/paths/admin/_cluster_compat_version-unfreeze.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| # Copyright 2026-Present Couchbase, Inc. | ||
| # | ||
| # Use of this software is governed by the Business Source License included | ||
| # in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
| # in that file, in accordance with the Business Source License, use of this | ||
| # software will be governed by the Apache License, Version 2.0, included in | ||
| # the file licenses/APL2.txt. | ||
| post: | ||
| summary: Clear the cluster compatibility version freeze | ||
| description: |- | ||
| Clears any pinned cluster compatibility version previously frozen via `POST /_cluster_compat_version/freeze`. | ||
|
|
||
| The reported `cluster_compat_version` will resume tracking the live-node minimum and may immediately advance if all nodes have been upgraded since the freeze was set. | ||
|
|
||
| Returns success only if the cluster is fully unfrozen. | ||
| If any part of the cluster remains frozen after the request, a `503` is returned with the current state - | ||
| the cluster compatibility version may still be held back, and the request should be retried. | ||
|
|
||
| Required Sync Gateway RBAC roles: | ||
|
|
||
| * Sync Gateway Dev Ops | ||
| responses: | ||
| '200': | ||
| description: Cluster compatibility version freeze has been cleared | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/ClusterCompatVersionState | ||
| '403': | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| '500': | ||
| description: An unexpected error occurred while clearing the cluster compatibility version freeze | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/HTTP-Error | ||
| '503': | ||
| description: |- | ||
| The unfreeze did not fully apply. The cluster compatibility version may still be held back | ||
| and the request should be retried. The response body is either a `ClusterCompatVersionState` | ||
| showing the residual freeze, or an `HTTP-Error` when cluster compatibility version tracking | ||
| is not enabled on this node, or when the unfreeze partially failed and the residual freeze | ||
| state could not be verified. | ||
| content: | ||
| application/json: | ||
| schema: | ||
| oneOf: | ||
| - $ref: ../../components/schemas.yaml#/ClusterCompatVersionState | ||
| - $ref: ../../components/schemas.yaml#/HTTP-Error | ||
| tags: | ||
| - Server | ||
| operationId: post__cluster_compat_version_unfreeze |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Copyright 2026-Present Couchbase, Inc. | ||
| # | ||
| # Use of this software is governed by the Business Source License included | ||
| # in the file licenses/BSL-Couchbase.txt. As of the Change Date specified | ||
| # in that file, in accordance with the Business Source License, use of this | ||
| # software will be governed by the Apache License, Version 2.0, included in | ||
| # the file licenses/APL2.txt. | ||
| get: | ||
| summary: Get the cluster compatibility version state | ||
| description: |- | ||
| Returns the cluster-wide cluster compatibility version, the per-node versions registered | ||
| in the cluster, and the frozen value if a freeze is currently in effect. | ||
|
|
||
| Without a freeze, `cluster_compat_version` is the minimum across all live nodes. With a | ||
| freeze, `cluster_compat_version` is pinned to `frozen_cluster_compat_version`. The | ||
| presence of `frozen_cluster_compat_version` in the response indicates that a freeze is set. | ||
|
|
||
| Required Sync Gateway RBAC roles: | ||
|
|
||
| * Sync Gateway Dev Ops | ||
| responses: | ||
| '200': | ||
| description: Returned the cluster compatibility version state successfully | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/ClusterCompatVersionState | ||
| '403': | ||
| $ref: ../../components/responses.yaml#/Unauthorized | ||
| '503': | ||
| description: Cluster compatibility version tracking is not enabled on this node | ||
| content: | ||
| application/json: | ||
| schema: | ||
| $ref: ../../components/schemas.yaml#/HTTP-Error | ||
|
bbrks marked this conversation as resolved.
|
||
| tags: | ||
| - Server | ||
| operationId: get__cluster_compat_version | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.