Stop calling an empty parity slot an emulated disk
mdNumDisabled counts a slot that was never populated, so HOST2 reported "Emulating 1 disk" for a parity2 slot with no disk in it. Emulation is a data-disk state, and an assigned identity is what separates a slot that lost its disk from one that never had one.
This commit is contained in:
@@ -1290,21 +1290,28 @@ function vvPollMonitor(live) {
|
||||
return new Date(ts * 1000).toLocaleString([], {weekday:'short',day:'numeric',month:'short',year:'numeric',hour:'2-digit',minute:'2-digit'});
|
||||
}
|
||||
|
||||
const numDisabled = par.num_disabled ?? 0;
|
||||
// num_emulated, not num_disabled: the array counts an empty parity slot as disabled, and
|
||||
// labelling that "Emulating 1 disk" described a failure that was not happening. See
|
||||
// vv_parity_status() for why parity slots are counted separately.
|
||||
const numEmulated = par.num_emulated ?? 0;
|
||||
const numParityDsbl = par.num_parity_disabled ?? 0;
|
||||
const numMissing = par.num_missing ?? 0;
|
||||
const degraded = numDisabled > 0 || numMissing > 0;
|
||||
const degraded = numEmulated > 0 || numMissing > 0;
|
||||
const exitColor = par.exit_label === 'Completed' ? '#4caf50' : par.exit_label === 'Aborted' ? '#ff9800' : '#f44336';
|
||||
const errColor = (par.errors ?? 0) > 0 ? '#f44336' : '#444';
|
||||
const speedStr = par.last_speed_mb ? ` · ${par.last_speed_mb} MB/s` : '';
|
||||
const nextDate = vvFmtDate(par.next_ts);
|
||||
const dueIn = vvDueIn(par.next_ts);
|
||||
const parBannerCls = !valid ? 'vv-banner-err' : degraded || (par.errors ?? 0) > 0 ? 'vv-banner-warn' : 'vv-banner-ok';
|
||||
const emulLabel = numDisabled > 0 ? `<span style="font-size:11px;">Emulating ${numDisabled} disk${numDisabled !== 1 ? 's' : ''}</span>` : '';
|
||||
const emulLabel = numEmulated > 0 ? `<span style="font-size:11px;">Emulating ${numEmulated} disk${numEmulated !== 1 ? 's' : ''}</span>` : '';
|
||||
const missingLabel = numMissing > 0 ? `<span style="font-size:11px;color:#f44336;">${numMissing} slot${numMissing !== 1 ? 's' : ''} missing</span>` : '';
|
||||
// A failed parity disk is a real fault and still has to surface — it just is not emulation,
|
||||
// and it does not mean data is being reconstructed.
|
||||
const parDsblLabel = numParityDsbl > 0 ? `<span style="font-size:11px;color:#ffb74d;">${numParityDsbl} parity disk${numParityDsbl !== 1 ? 's' : ''} disabled</span>` : '';
|
||||
|
||||
let html = `<div class="vv-banner ${parBannerCls}">
|
||||
<span>${valid ? '✓ Valid' : '✗ INVALID'}</span>
|
||||
${emulLabel}${missingLabel}
|
||||
${emulLabel}${missingLabel}${parDsblLabel}
|
||||
${(par.errors ?? 0) > 0 ? `<span style="font-size:11px;">${par.errors} error${par.errors !== 1 ? 's' : ''}</span>` : ''}
|
||||
</div>`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user