fix: use stop-first update order for all database services (#4560)

Docker Swarm's default start-first update order causes new database
containers to fail with 'DBPathInUse' because two containers compete
for the same data volume simultaneously. Docker then rolls back the
update, silently reverting any env var or config changes.

Using stop-first ensures the old container is stopped before the new
one starts, preventing volume lock conflicts across all database types.

Fixes #4550
This commit is contained in:
Mauricio Siu
2026-06-06 14:49:24 -06:00
committed by GitHub
parent e6fc3db08f
commit e944603f99
6 changed files with 30 additions and 6 deletions
@@ -140,7 +140,11 @@ export const buildLibsql = async (libsql: LibsqlNested) => {
: []),
],
},
UpdateConfig,
UpdateConfig: libsql.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {
const service = docker.getService(appName);
@@ -111,7 +111,11 @@ export const buildMariadb = async (mariadb: MariadbNested) => {
]
: [],
},
UpdateConfig,
UpdateConfig: mariadb.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {
const service = docker.getService(appName);
+5 -1
View File
@@ -167,7 +167,11 @@ ${command ?? "wait $MONGOD_PID"}`;
]
: [],
},
UpdateConfig,
UpdateConfig: mongo.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {
+5 -1
View File
@@ -117,7 +117,11 @@ export const buildMysql = async (mysql: MysqlNested) => {
]
: [],
},
UpdateConfig,
UpdateConfig: mysql.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {
const service = docker.getService(appName);
@@ -109,7 +109,11 @@ export const buildPostgres = async (postgres: PostgresNested) => {
]
: [],
},
UpdateConfig,
UpdateConfig: postgres.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {
const service = docker.getService(appName);
+5 -1
View File
@@ -115,7 +115,11 @@ export const buildRedis = async (redis: RedisNested) => {
]
: [],
},
UpdateConfig,
UpdateConfig: redis.updateConfigSwarm ?? {
Parallelism: 1,
Order: "stop-first" as const,
FailureAction: "rollback" as const,
},
};
try {