fix: retain the previous UUID for newly replaced drives (#10759)

only newly replaced drives get the new `format.json`,
this avoids disks reloading their in-memory reference
format, ensures that drives are online without
reloading the in-memory reference format.

keeping reference format in-tact means UUIDs
never change once they are formatted.
This commit is contained in:
Harshavardhana
2020-10-26 10:29:29 -07:00
committed by GitHub
parent 649035677f
commit 029758cb20
11 changed files with 100 additions and 274 deletions
+1 -5
View File
@@ -33,7 +33,7 @@ import (
const (
// Lock maintenance interval.
lockMaintenanceInterval = 15 * time.Second
lockMaintenanceInterval = 30 * time.Second
// Lock validity check interval.
lockValidityCheckInterval = 5 * time.Second
@@ -311,12 +311,8 @@ func lockMaintenance(ctx context.Context, interval time.Duration) error {
// less than the quorum, we have locks expired.
if nlripsMap[nlrip.name].locks < nlrip.lri.Quorum {
// The lock is no longer active at server that originated
// the lock, attempt to remove the lock.
globalLockServers[lendpoint].mutex.Lock()
// Purge the stale entry if it exists.
globalLockServers[lendpoint].removeEntryIfExists(nlrip)
globalLockServers[lendpoint].mutex.Unlock()
}
}