Skip to content

Commit 21e119d

Browse files
committed
fix: guard MinIO to RustFS deployment upgrades
Signed-off-by: Zoorpha <[email protected]>
1 parent 3e903b8 commit 21e119d

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

‎deploy/compose/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ keypair.
4747
`<bucket>.rustfs`. It is not configurable for an external S3 provider through
4848
`.env`; use the Helm chart or a custom Compose configuration for providers
4949
such as new Railway Storage Buckets that require `virtual` addressing.
50+
- RustFS does not read the previous MinIO filesystem layout. Existing MinIO
51+
deployments must migrate objects through the S3 API and verify a backup before
52+
switching; `./run.sh start`, `restart`, and `upgrade` refuse to create the new
53+
RustFS volume automatically while only the legacy MinIO volume exists.
5054

5155
Run `./run.sh backup-hint` for the backup checklist.
5256

‎deploy/compose/compose.dev.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ services:
99

1010
rustfs:
1111
ports:
12-
- "${MINIO_API_PORT:-9000}:9000"
13-
- "${MINIO_CONSOLE_PORT:-9001}:9001"
12+
- "${RUSTFS_API_PORT:-9000}:9000"
13+
- "${RUSTFS_CONSOLE_PORT:-9001}:9001"
1414

1515
adminer:
1616
image: adminer:latest

‎deploy/compose/run.sh‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ MSG
3535
fi
3636
}
3737

38+
guard_legacy_minio_volume() {
39+
local legacy_volume="buzz-prod_buzz-minio-data"
40+
local rustfs_volume="buzz-prod_buzz-rustfs-data"
41+
if docker volume inspect "${legacy_volume}" >/dev/null 2>&1 &&
42+
! docker volume inspect "${rustfs_volume}" >/dev/null 2>&1; then
43+
cat >&2 <<'MSG'
44+
The previous MinIO data volume exists, but the RustFS data volume does not.
45+
Buzz will not create a new empty RustFS store and hide existing objects.
46+
Migrate the objects through the S3 API, verify the backup, then retry.
47+
MSG
48+
return 1
49+
fi
50+
}
51+
3852
backup_hint() {
3953
cat <<'MSG'
4054
Back up these before upgrades and on a regular schedule:
@@ -53,13 +67,15 @@ MSG
5367
case "${1:-help}" in
5468
start|up)
5569
require_env
70+
guard_legacy_minio_volume
5671
compose up -d --wait
5772
;;
5873
stop|down)
5974
compose down
6075
;;
6176
restart)
6277
require_env
78+
guard_legacy_minio_volume
6379
compose up -d --wait --force-recreate relay
6480
;;
6581
pull)
@@ -68,6 +84,7 @@ case "${1:-help}" in
6884
;;
6985
upgrade)
7086
require_env
87+
guard_legacy_minio_volume
7188
compose pull
7289
compose up -d --wait
7390
backup_hint

0 commit comments

Comments
 (0)