mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-08-18 13:17:08 +00:00
fix: apply maintenance script defaults in gRPC handler
The gRPC handler for GetMasterConfiguration read maintenance scripts from viper without calling SetDefault, relying on startAdminScripts having run first. If the admin server calls GetMasterConfiguration before startAdminScripts sets the defaults, viper returns empty strings and the seeding is silently skipped. Apply SetDefault in the gRPC handler itself so it is self-contained. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
4b2a231913
commit
068a506330
@@ -456,7 +456,11 @@ func (ms *MasterServer) GetMasterConfiguration(ctx context.Context, req *master_
|
||||
leader, _ := ms.Topo.Leader()
|
||||
|
||||
// MIGRATION: expose maintenance scripts for admin server seeding. Remove after March 2027.
|
||||
// Apply defaults here rather than relying on startAdminScripts having called SetDefault,
|
||||
// since this gRPC handler can be reached before startAdminScripts runs.
|
||||
v := util.GetViper()
|
||||
v.SetDefault("master.maintenance.scripts", maintenance.DefaultMasterMaintenanceScripts)
|
||||
v.SetDefault("master.maintenance.sleep_minutes", maintenance.DefaultMaintenanceSleepMinutes)
|
||||
maintenanceScripts := v.GetString("master.maintenance.scripts")
|
||||
maintenanceSleepMinutes := v.GetInt("master.maintenance.sleep_minutes")
|
||||
if maintenanceSleepMinutes <= 0 {
|
||||
|
||||
Reference in New Issue
Block a user