Skip to content

fix: pick #681, #693 (92995699) and #702 into release_3.2.0 (3.2.0) - #709

Merged
github-actions[bot] merged 3 commits into
release_3.2.0from
fix/1618-2115-257-3.2.0-picks
Oct 28, 2026
Merged

github-actions[bot] merged 3 commits into
release_3.2.0from
fix/1618-2115-257-3.2.0-picks

Conversation

@raven-pan

@raven-pan raven-pan commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind bug


Which issue(s) this PR fixes?

Refs bigstack-oss/cubecos#1618
Refs bigstack-oss/cubecos#2115
Refs bigstack-oss/cubecos-private#257

Ticket Release field Source PR on develop
cubecos#1618 COS 3.2.0 #681
cubecos#2115 (API side only) COS 3.2.0 #693
cubecos-private#257 COS 3.2.0 #702

What this PR does?

Cherry-picks the three develop commits whose tickets have Release = COS 3.2.0 but which are not on release_3.2.0 yet. To find them, I compared all 41 develop commits since the release_3.1.20 fork with the upstream tickets. No commit on release_3.2.0 belongs to a release other than 3.2.0. These three are the only 3.2.0 commits still missing. The other five develop-only commits are dependabot bumps with no ticket, so this PR leaves them out.

QA view

What changes on a 3.2.0 cluster:

  1. Home > Chart storage charts show data (cubecos#1618). The bandwidth, IOPS and latency charts were empty because cube-cos-api read a retired InfluxDB bucket. It now reads Ceph metrics from Prometheus.
  2. Firmware upgrade progress follows a rolling restart (API side of cubecos#2115). During cluster rolling_restart, upgrade progress now shows the restart roll and its phases, and it keeps answering while a node reboots. The two #2115 defects themselves (abort still reboots the draining node, no masakari maintenance) live in cubecos sdk_power.sh. This PR does not fix them.
  3. klauspost/compress goes from 1.18.0 to 1.18.7 (cubecos-private#257). This fixes GHSA-259r-337f-4rfw (CVE-2026-63209), an out-of-bounds write in the s2 decoder. No behavior changes. The other half of Enhance the api experience for tuning, license, and support file operation #257, building with Go 1.27.3, is the cubecos jail image, not this repo.

Repo dependencies:

  • The charts depend on cubecos serving /prometheus through haproxy (single node: local Prometheus; HA: Thanos queriers) and on Prometheus scraping ceph. cubecos release_3.2.0 has both: the haproxy route in config_haproxy.cpp, and the ceph scrape fix cubecos#1593 (develop twin of #1592).
  • The upgrade progress change comes with the openapi doc commit eba4190 (roll kind and phases). cube-cos-ui already reads isRollingApplied and the per-node phase, so the firmware update page gets the fix with no UI change. cube-cos-ui does not read the new kind field yet.
  • New optional config store.prometheus.url in /etc/cube/api/cube-cos-api.yaml. Empty means http://<data center VIP>/prometheus.

Checklist:

  • Home > Chart: the storage bandwidth, IOPS and latency charts show non-empty series on a cluster with Ceph I/O.
  • GET /api/v1/metrics/storage-read-write-bytes returns non-empty read / write.
  • Latency chart follows the selected time range (before, it always showed the last 62 minutes).
  • Known gap: the charts do not move forward while the page stays open. That is cubecos#1766, a cube-cos-ui bug (the poll reuses the time window from page load). This PR does not fix it.
  • Start cluster rolling_restart. Firmware upgrade progress shows a roll of kind restart with per-node phases. It is not "all succeeded".
  • While a node in the roll reboots, the upgrade progress endpoint never returns 500.
  • After the roll, firmware upgrade still works as before.

Developer view

Pick Source commit Source PR Change
8c9f3d90 b0764d6b #681 New internal/prometheus query_range client. internal/cubecos/storagemetric.go replaces the Flux queries in metric.go. Adds store.prometheus.url to internal/config and configs/cube-cos-api.yaml.template.
8680918e 92995699 #693 internal/cubecos/firmware.go projects any in-flight roll from power_roll_status_json, writes progress.json atomically, and serves the last projection or 503 while the roll state cannot be read. Bumps api/cube-cos-openapi 50979fd → eba4190 (that doc commit only).
2b287c11 e9d4cd22 #702 go.mod / go.sum: klauspost/compress v1.18.0 → v1.18.7.

For rc builds. RC builds take cube-cos-api from CUBE_COS_API_RPM (cubecos core/component-refs.mk:11, still v3.2.0-rc1 from 575bb9b). For the next RC to include this PR, someone has to build a new RPM and update that line, as with #707 and #708.


Test results (optional)

1). make sure the api docs have been updated

task generateApiDocs on this branch leaves no diff. The submodule bump comes from the picked commit.


2). make sure the api works properly

On this branch, macOS arm64:

  • GOWORK=off CGO_ENABLED=1 go vet ./internal/... reports nothing.
  • go test -count=1 ./internal/...: 372 passed, 0 failed.
  • go mod tidy leaves no diff.

Not built in the x86 container and not run against a cluster on this branch. The live-node results are in each source PR.

🤖 Generated with Claude Code

raven-pan and others added 3 commits October 28, 2026 14:54
…d ceph bucket (#1618)

The three storage charts on Home > Chart (bandwidth, IOPS, latency) were
empty on every cluster. Their eight Flux statements read the "ceph" InfluxDB
bucket. The ceph-mgr influx module that wrote that bucket was retired
(cubecos #1442), so the API returned 200 with empty read/write series.

The same per-OSD counters are exported by ceph-mgr's prometheus module. The
charts now query them the way the Grafana storage dashboard does:

- bandwidth: sum(rate(ceph_osd_op_{r_out,w_in}_bytes[w]))
- iops:      sum(rate(ceph_osd_op_{r,w}[w]))
- latency:   rate(..._latency_sum) / rate(..._latency_count) * 1000 (ms)

Behavior changes:

- Bandwidth is now the sum across OSDs. The old statement took the max of
  one OSD per point, which did not match the IOPS chart or Grafana.
- Latency now follows the request's start/stop. It used to ignore them and
  always read the last 62 minutes.
- A 0/0 latency step (no ops) reads 0, not NaN.

The rate window is max(step, 4m): Prometheus scrapes ceph every 60s, and
four scrapes keep one missed scrape from blanking a point.

New pieces:

- internal/prometheus: a small query_range client. It calls haproxy's
  /prometheus route, which is the local server on a single node and the
  thanos queriers in HA.
- store.prometheus.url config. Empty means http://<data center VIP>/prometheus,
  the same host the InfluxDB client uses.

Removes the eight ceph-bucket statements and the helpers only they used.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
(cherry picked from commit b0764d6)
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
… answering

upgradeProgress only projected the shared roll job when its kind was
upgrade, so during `cluster rolling_restart` every node read back as
succeeded with no phase and isRollingApplied false. It now projects any
in-flight roll from power_roll_status_json and reports its kind (upgrade
or restart); the firmware logic built on the same progress still sees
only an upgrade roll, and a restart projection is never written into
progress.json.

It also kept failing while a node went down:
- progress.json was rewritten in place; a master that rebooted mid-write
  left it full of NUL bytes and the endpoint answered 500. Every writer
  now writes atomically (temp file, fsync, rename, dir fsync), and a file
  that does not parse falls back to the last good copy or is rebuilt.
- while cephfs unmounts on a shutting-down node the roll state cannot be
  read: the endpoint serves the last projection (up to 2 min) or answers
  503, instead of 500 or a 200 that shows a roll with no nodes.

Refs bigstack-oss/cubecos#2115

Signed-off-by: Travis Wu <travis.wu@bigstack.co>
(cherry picked from commit 9299569)
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
GHSA-259r-337f-4rfw (CVE-2026-63209) is an out-of-bounds write in
klauspost/compress's s2 decoder, fixed in v1.18.7. cube-cos-api takes
v1.18.0 indirectly, through the mongo driver's zstd compressor, and the
cubecos scan reports it on /usr/local/bin/cube-cos-api. go mod tidy
changes nothing else.

Verified on WORK_STATION with go1.27.2. The binary builds with GOWORK=off
and links compress v1.18.7 (go version -m), go vet ./... reports nothing,
and go test ./... passes in all 21 packages that have tests.

Refs bigstack-oss/cubecos-private#257

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Seki Xu <seki.xu@bigstack.co>
(cherry picked from commit e9d4cd2)
Signed-off-by: raven-pan-bigstack <raven.pan@bigstack.co>
@Eandalf-Bigstack
Eandalf-Bigstack marked this pull request as ready for review October 28, 2026 09:34
@Eandalf-Bigstack
Eandalf-Bigstack requested a review from a team as a code owner October 28, 2026 09:34
@Eandalf-Bigstack Eandalf-Bigstack added the done Merge the pull request label Oct 28, 2026
@github-actions
github-actions Bot merged commit 2b287c1 into release_3.2.0 Oct 28, 2026
5 checks passed
@github-actions
github-actions Bot deleted the fix/1618-2115-257-3.2.0-picks branch October 28, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

done Merge the pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants