From 35bd99fae3c317e07481476ba78dcdc0f3b033f5 Mon Sep 17 00:00:00 2001 From: Alex Aizman Date: Wed, 20 Nov 2024 15:45:01 -0500 Subject: [PATCH] copy bucket (job): amend quiescing logic, add log Signed-off-by: Alex Aizman --- space/cleanup.go | 4 ++++ xact/xs/tcb.go | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/space/cleanup.go b/space/cleanup.go index 74c581e3fc..7c3d891c21 100644 --- a/space/cleanup.go +++ b/space/cleanup.go @@ -477,6 +477,7 @@ func (j *clnJ) visitObj(fqn string, lom *core.LOM) { return } + // TODO: switch // too early; NOTE: default dont-evict = 2h if lom.AtimeUnix()+int64(j.config.LRU.DontEvictTime) > j.now { if cmn.Rom.FastV(5, cos.SmoduleSpace) { @@ -512,6 +513,9 @@ func (j *clnJ) rmExtraCopies(lom *core.LOM) { return // must be busy } defer lom.Unlock(true) + + // TODO: switch + // reload under lock and check atime - again if err := lom.Load(false /*cache it*/, true /*locked*/); err != nil { if !cos.IsNotExist(err, 0) { diff --git a/xact/xs/tcb.go b/xact/xs/tcb.go index ce08a31025..8d699ecf15 100644 --- a/xact/xs/tcb.go +++ b/xact/xs/tcb.go @@ -234,17 +234,19 @@ func (r *XactTCB) Run(wg *sync.WaitGroup) { } func (r *XactTCB) qcb(tot time.Duration) core.QuiRes { - // TODO -- FIXME ======================= - if cnt := r.ErrCnt(); cnt > 0 { - // to break quiescence - the waiter will look at r.Err() first anyway - return core.QuiTimeout + since := mono.Since(r.rxlast.Load()) + + // log + if (tot > cmn.Rom.MaxKeepalive() || since > cmn.Rom.MaxKeepalive()) && + (cmn.Rom.FastV(4, cos.SmoduleXs) || tot < cmn.Rom.MaxKeepalive()<<1) { + nlog.Warningln(r.Name(), "quiescing [", since, tot, "rc", r.refc.Load(), "errs", r.ErrCnt(), "]") } - since := mono.Since(r.rxlast.Load()) if r.refc.Load() > 0 { if since > cmn.Rom.MaxKeepalive() { + conf := &r.BckJog.Config.Timeout // idle on the Rx side despite having some (refc > 0) senders - if tot > r.BckJog.Config.Timeout.SendFile.D() { + if tot > conf.SendFile.D() || (since > conf.MaxHostBusy.D() && tot > conf.MaxHostBusy.D()) { return core.QuiTimeout } }