mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-11-24 08:46:54 +08:00
find master address earlier
This commit is contained in:
@@ -135,6 +135,25 @@ func (t *EcVacuumTask) Execute(ctx context.Context, params *worker_pb.TaskParams
|
||||
|
||||
t.LogInfo("Starting EC vacuum task with runtime generation detection", logFields)
|
||||
|
||||
// Step 0.5: Get master address early for generation activation
|
||||
if t.masterAddress == "" {
|
||||
if err := t.fetchMasterAddressFromAdmin(); err != nil {
|
||||
t.LogWarning("Failed to get master address - generation activation will be manual", map[string]interface{}{
|
||||
"error": err.Error(),
|
||||
"volume_id": t.volumeID,
|
||||
"target_generation": t.targetGeneration,
|
||||
"note": "Task will continue but activation must be done manually",
|
||||
})
|
||||
// Continue execution - this is not fatal, just means manual activation required
|
||||
} else {
|
||||
t.LogInfo("Master address obtained for automatic generation activation", map[string]interface{}{
|
||||
"master_address": t.masterAddress,
|
||||
"volume_id": t.volumeID,
|
||||
"target_generation": t.targetGeneration,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
// Step 1: Create temporary working directory
|
||||
if err := t.createTempDir(); err != nil {
|
||||
return fmt.Errorf("failed to create temp directory: %w", err)
|
||||
|
||||
@@ -11,11 +11,9 @@ import (
|
||||
|
||||
// performSafetyChecks performs comprehensive safety verification before cleanup
|
||||
func (t *EcVacuumTask) performSafetyChecks() error {
|
||||
// Get master address from admin server if not already set
|
||||
// Master address should have been fetched early in execution
|
||||
if t.masterAddress == "" {
|
||||
if err := t.fetchMasterAddressFromAdmin(); err != nil {
|
||||
return fmt.Errorf("CRITICAL: cannot perform safety checks - failed to get master address: %w", err)
|
||||
}
|
||||
return fmt.Errorf("CRITICAL: cannot perform safety checks - master address not available (should have been fetched during task initialization)")
|
||||
}
|
||||
|
||||
// Safety Check 1: Verify master connectivity and volume existence
|
||||
|
||||
Reference in New Issue
Block a user