Skip to content

Commit

Permalink
copy bucket (job): amend quiescing logic, add log
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Aizman <alex.aizman@gmail.com>
  • Loading branch information
alex-aizman committed Nov 20, 2024
1 parent 18e0b10 commit 35bd99f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions space/cleanup.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
14 changes: 8 additions & 6 deletions xact/xs/tcb.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
Expand Down

0 comments on commit 35bd99f

Please sign in to comment.